data(tobaccovote)
# sample all variables without replacement
( ans1 <- sample.df(tobaccovote,10) )
# sample two variables without replacement
( ans2 <- sample.df(tobaccovote,25,vars=c("votedpro","party")) )
# sample two variables with replacement
( ans3 <- sample.df(tobaccovote,25,replace=TRUE,vars=c("votedpro","party")) )
Run the code above in your browser using DataLab