powered by
This function takes a sample of the specified size from the rows of x using either with or without replacement.
x
sample.rows(x, size, replace = FALSE, prob = NULL)
A data frame of the same shape as x.
A data frame.
A non-negative integer giving the number of items to choose.
Should sampling be with replacement?
A vector of probability weights for obtaining the rows of the data frame being sampled.
This function internally calls sample.int().
sample.int()
Other deprecated functions: coalesce.na-deprecated, df_to_list-deprecated, hms.to.seconds-deprecated, kimisc-deprecated, list_to_df-deprecated, nc-deprecated, nlist-deprecated, ofactor-deprecated, seconds.to.hms-deprecated, thisfile-deprecated, tll-deprecated, vswitch-deprecated
coalesce.na-deprecated
df_to_list-deprecated
hms.to.seconds-deprecated
kimisc-deprecated
list_to_df-deprecated
nc-deprecated
nlist-deprecated
ofactor-deprecated
seconds.to.hms-deprecated
thisfile-deprecated
tll-deprecated
vswitch-deprecated
set.seed(42) sample.rows( data.frame(a = c(1, 2, 3), b = c(4, 5, 6), row.names = c("a", "b", "c")), 10, replace = TRUE )
Run the code above in your browser using DataLab