Learn R Programming

stratifiedyh (version 0.1.0)

systematic_labels: Systematic Sampling and Labeling

Description

This function performs systematic sampling on the dataframe and assigns "Yes" or "No" labels to rows based on the specified interval.

Usage

systematic_labels(df, group_col, sampling_interval)

Value

A data frame with an additional column "Systematic_Yes_No" containing the systematically sampled "Yes"/"No" labels.

Arguments

df

A data frame containing the data.

group_col

A character string specifying the column to use for grouping.

sampling_interval

A numeric value representing the interval for systematic sampling.

Examples

Run this code
result <- systematic_labels(iris, group_col = "Species", sampling_interval = 2)

Run the code above in your browser using DataLab