Hi,

Thank you very much for your help! Here is the coding I used to make it
work:

    x <- textConnection("A 2.5 3.4 2.7 5.6 5.7 5.4 10.1 9.4 
    B 5.3 5.4 6.5 7.5 1.3 4.5 10.5 4.1 
    C 2.1 2.3 2.1 5.4 9.0 4.5 20.1 3.7")
    dat <- read.table(x)
    nv <- 2 # Number of variables that are repeated in sequence
    mkvarying <-
function(n)list(paste("V",seq(nv,n,by=nv),sep=""),paste("V",seq(nv+1,n,by=nv),sep=""))
   
reshape(dat,idvar="V1",varying=mkvarying(I(length(dat))),direction="long",timevar=NULL)

It is a good idea to first read the data then rearrange them in a second
step.

Rock
DRF-MRNF, Quebec
-- 
View this message in context: 
http://n4.nabble.com/Read-data-in-sequences-tp1819487p1836275.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to