sample.rows-deprecated

0th

Percentile

Random Samples and Permutations for Data Frames

This function takes a sample of the specified size from the rows of x using either with or without replacement.

Usage
sample.rows(x, size, replace = FALSE, prob = NULL)
Arguments
x

A data frame.

size

A non-negative integer giving the number of items to choose.

replace

Should sampling be with replacement?

prob

A vector of probability weights for obtaining the rows of the data frame being sampled.

Details

This function internally calls sample.int().

Value

A data frame of the same shape as x.

See Also

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

Aliases
  • sample.rows-deprecated
  • sample.rows
Examples
# NOT RUN {
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)
# }
Documentation reproduced from package kimisc, version 0.4, License: GPL-3

Community examples

Looks like there are no examples yet.