Learn R Programming

Cyclops (version 3.5.0)

reduce: Apply simple data reductions

Description

reduce reports the count of non-zero elements, sum and sum-of-squares for specified covariates in a Cyclops data object.

Usage

reduce(object, covariates, groupBy, power = 1)

Value

Specified reduction as number or data.frame if segmented.

Arguments

object

A Cyclops data object

covariates

Integer or string vector: list of covariates to report

groupBy

Integer or string (optional): generates a segmented reduction stratified by this covariate. Setting groupBy = "stratum" segments reduction for strataID

power

Integer: 0 = non-zero count, 1 = sum, 2 = sum-of-squares