I fount out a solution ... check it out random_sample = function (dt, sample_size) { # determine the number of records in the data frame length_dt = length (dt[,1]) # extract the sample dt [sample (1:length_dt, size = sample_size),] }
-- View this message in context: http://r.789695.n4.nabble.com/Linear-regression-on-dataframe-s-sample-tp4648288p4648291.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.