[R] Reconstruct array dataset

John Kane jrkrideau at yahoo.ca
Wed Nov 21 16:56:29 CET 2007


I seem to be missing something. How can you have a
rectanglar data.frame of 12* 50 and convert it into 11
* x?  600/11 is not an integer.  

However leaving that minor detail aside: Let xx be the
data.frame that you have read in: 
yy <- unlist(xx)
zz <- t(matrix(yy, nrow=11))

might work.  



--- marcg <mdgi at gmx.ch> wrote:

> Hi there
> 
> I have an interesting problem:
> 
> My csv file is of array dimensions [12,50], but it
> was saved the wrong way: there should be only 11
> colums. What happens now if I read it into R is that
> the whole data set is shifted ( in the first row,
> the last column contains already the first value of
> the supposed second row and so on...)
> 
> how can I tell R to switch after 11 read values to
> the next row, taking the value from column 12 as
> first in the new row (for row 3 the two second last
> of the upper row etc...)
> 
> Thanks for suggestions
> 
> marc
> -- 
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
> 
> ______________________________________________
> 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