[R] some help

PIKAL Petr petr.pikal at precheza.cz
Thu Nov 29 16:02:39 CET 2012


Hi

Maybe you could use  stack(dat) or melt(dat) from reshape package.

Regards
Petr

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of dattel_palme
> Sent: Monday, November 26, 2012 12:13 PM
> To: r-help at r-project.org
> Subject: Re: [R] some help
> 
> Hey again!
> 
> I finally, after some work done before, had time to apply the code.
> The sorting of the table did not work well or maybe something was
> misunderstood.
> 
> I have a table with 973 rows and 1329 col (ascii/text file). I want to
> sort the table that all columns are one under each other so that at the
> end I have 973*1329 rows and 1 col. The col should be sorted in a way
> that col 2 is under col 1, col 3 under col 2, col 4 under col 3 etc.
> 
> I applied this code:
> dat <- read.table(filename, sep=<separator>, header=TRUE) stacked <-
> do.call(rbind, dat)
> unlist(dat)
> 
> ..but putting dim(dat), the number of rows and col was still 973 and
> 1329.
> So seemingly it did not work as i wanted.
> 
> Thanks very much for more help.
> 
> Stefan
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/some-help-
> tp4648316p4650828.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list