[R] Transpose and replicate

Alex99 loyola9988 at yahoo.com
Fri Nov 28 15:41:48 CET 2008



Hi all,
I used the "replicate" function to make 2 samples from file test with 5
records in each sample and saved the output in "result".

result=replicate(2,test[,sample(colnames(test),5,replace =
FALSE)],simplify=FALSE)

now I need to transpose each sample, but when I use:

t(result) 

or  

result=t(replicate(2,test[,sample(colnames(test),5,replace =
FALSE)],simplify=FALSE))

I get this:

        [,1]             [,2]           [,3]            [,4]         [,5]       
[1,] Integer,300 Integer,300 Integer,300 Integer,300 Integer,300

anyone has any idea how can I fix it?
Thanks


-- 
View this message in context: http://www.nabble.com/Transpose-and-replicate-tp20735722p20735722.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list