transpose rows and columns
I have a dataset in excel/ txt file with 65 columns and 300000 rows. What will be the best way to switch columns and rows. It cannot be done in excel. I tried using R t() it also does not do the trick.
any suggestion?
Thanks
• 8,557 views
•
link
3 answers
I have a blog post containing Python and Perl code for carrying out a transpose on tab-delimited files. In the post, I also linked to a tool called datamash, which can carry out a transpose. Here's the URL: http://davetang.org/muse/2014/09/09/transpose-tool/.
• 0 views
•
link
Here's an elegant and fast method in awk: http://stackoverflow.com/questions/1729824/transpose-a-file-in-bash
• 0 views
•
link
Log in to answer this question.
t()works on at least some data.frames (and indeed you can transpose sheets in excel, though I'd keep a 300K row sheet out of excel if I were you!). So what error messages to you get when you try to do this transposition?Here is so far I have used-
It is not changing the rows and columns and does not throw any error
You need to set the result when transposing.
will work.
My bad.
Thanks it worked