Re: [R] transpose rows and columns for large data

2016-11-30 Thread John Dougherty
On Tue, 29 Nov 2016 17:22:47 + (UTC) Elham - via R-help wrote: > Is there another way (I prefer a way with Excel)? Search on "friends don't let friends use excel for statistics." Spreadsheets are an inherently perilous way to do statistics and Excel specifically is notoriously poor. In fact

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Marc Schwartz
Hi, To provide a [very] small example of what Bert is referring to: DF <- data.frame(Letters = letters[1:4], int = 1:4) > str(DF) 'data.frame': 4 obs. of 2 variables: $ Letters: Factor w/ 4 levels "a","b","c","d": 1 2 3 4 $ int: int 1 2 3 4 > DF Letters int 1 a 1 2 b

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Bert Gunter
No, no. It *is* for transposing. But it is *what* you are transposing -- a data frame -- that may lead to the problems. You will have to read what I referred you to and perhaps spend time with an R tutorial or two (there are many good ones on the web) if your R learning is not yet sufficient to und

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Bert Gunter
It is probably worth mentioning that this (i.e. transposing a data frame) can be a potentially disastrous thing to do in R, though the explanation is probably more than you want to know at this point (see ?t and follow the 'as.matrix' link for details). But if you start getting weird results and

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Elham - via R-help
thank you all,it worked On Tuesday, November 29, 2016 9:49 PM, "Dalthorp, Daniel" wrote: Try David's suggestion to spell the argument "stringsAsFactors" correctly. Then: data <- read.table("your_file_location", sep ="\t", comment.char = "", stringsAsFactors = F, header = T) transpose

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Dalthorp, Daniel
Try David's suggestion to spell the argument "stringsAsFactors" correctly. Then: data <- read.table("your_file_location", sep ="\t", comment.char = "", stringsAsFactors = F, header = T) transpose_data <- t(data) -Dan On Tue, Nov 29, 2016 at 9:56 AM, Elham - via R-help wrote: > yes you have rig

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Bert Gunter
It's 'stringsAsFactors' = FALSE (without my added quotes) with an 's' at the end of 'strings' . -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Nov

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Elham - via R-help
yes you have right about excel.by R,what should I do for transposing row and column? On Tuesday, November 29, 2016 9:13 PM, David Winsemius wrote: > On Nov 29, 2016, at 9:22 AM, Elham - via R-help wrote: > > Hi, > > I am trying to transpose large datasets inexcel (44 columns and 57

Re: [R] transpose rows and columns for large data

2016-11-29 Thread David Winsemius
> On Nov 29, 2016, at 9:22 AM, Elham - via R-help wrote: > > Hi, > > I am trying to transpose large datasets inexcel (44 columns and 57774 rows) > but it keeps giving me the message we can'tpaste because copy area and paste > area aren't the same size. Is there a way totranspose all the data

[R] transpose rows and columns for large data

2016-11-29 Thread Elham - via R-help
Hi, I am trying to transpose large datasets inexcel (44 columns and 57774 rows) but it keeps giving me the message we can'tpaste because copy area and paste area aren't the same size. Is there a way totranspose all the data at one time instead of piece by piece? One dataset has agreat amount of