[R] Sampling problems

Oritteropus lucasantini85 at hotmail.com
Thu Mar 8 09:56:47 CET 2012


Hi, thank you but it does work for vectors and matrix but not dataframes, it
gives me this message error:

MeanA <- read.csv("MeanAmf.csv",header=T)
mysample <- MeanA[sample(1:nrow(MeanA), 20, replace=FALSE),]
remainder<-MeanA[-mysample]
Error in `[.default`(MeanA, -mysample) : invalid subscript type 'list'
In Ops.factor(left) : - not meaningful for factors

Any other way?

--
View this message in context: http://r.789695.n4.nabble.com/Sampling-problems-tp4453752p4455912.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list