[R] oversampling code

loubna181 loubn181 at gmail.com
Tue Nov 1 17:32:25 CET 2011

Thanks all for your responses, but as I m a new user of R while trying to
apply what David suggests I dont know what *"dorm" *refers to.

dfrm[c(rownames(dfrm[*dorm*$Y==1,]), sample(rownames(dfrm[dfrm$Y==0]),
0.10)) , ] 

But to give you more details , I'm working on a table calles balance from
UCI machine learning
I do have a variable called class and takes 3 values : B, L and R.
B represents 8% of the total and L and R 46% each one.
The purpose is to have a data set with 10% of B, 40% of L and 40% of R.
Thank u 

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

More information about the R-help mailing list