A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://spark.apache.org/docs/latest/api/R/reference/sampleBy.html below:

Returns a stratified sample without replacement — sampleBy • SparkR

Returns a stratified sample without replacement based on the fraction given on each stratum.

Usage
sampleBy(x, col, fractions, seed)

# S4 method for class 'SparkDataFrame,character,list,numeric'
sampleBy(x, col, fractions, seed)
Arguments
x

A SparkDataFrame

col

column that defines strata

fractions

A named list giving sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero.

seed

random seed

Value

A new SparkDataFrame that represents the stratified sample

Note

sampleBy since 1.6.0

Examples
if (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