Learn R Programming

disk.frame (version 0.1.0)

sample_frac.disk.frame: Sample n rows from a disk.frame

Description

Sample n rows from a disk.frame

Usage

# S3 method for disk.frame
sample_frac(tbl, size = 1, replace = FALSE,
  weight = NULL, .env = NULL, ...)

Arguments

tbl

a disk.frame

size

the proportion/fraction of rows to sample

replace

TRUE to sample with replacement; FALSE to sample without replacement

weight

weight of each row. NOT implemented

.env

for compatibility

...

passed to dplyr

Examples

Run this code
# NOT RUN {
cars.df = as.disk.frame(cars)

collect(sample_frac(cars.df, 0.5))

# clean up cars.df
delete(cars.df)
# }

Run the code above in your browser using DataLab