Returns a stratified sample without replacement based on the fraction given on each stratum.
UsagesampleBy(x, col, fractions, seed)
# S4 method for class 'SparkDataFrame,character,list,numeric'
sampleBy(x, col, fractions, seed)
Arguments
A SparkDataFrame
column that defines strata
A named list giving sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero.
random seed
A new SparkDataFrame that represents the stratified sample
NotesampleBy since 1.6.0
Examplesif (FALSE) { # \dontrun{
df <- read.json("/path/to/file.json")
sample <- sampleBy(df, "key", fractions, 36)
} # }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4