subset.scdf: Subset cases, rows, and variables

View source: R/subset.scdf.R

subset.scdfR Documentation

Subset cases, rows, and variables

Description

This function is mainly used to filter rows by a logical expression. It has also arguments to filter variables and cases.

Usage

## S3 method for class 'scdf'
subset(x, subset, select, cases, ...)

Arguments

x

An scdf object.

subset

Logical expression indicating rows to keep: missing values are taken as false.

select

Expression, indicating columns to select from an scdf.

cases

Expression, indicating cases to keep from an scdf.

...

not implemented

Value

An scdf.

Examples

exampleAB |>
  subset((values < 60 & phase == "A") | (values >= 60 & phase == "B"))
subset(exampleAB_add, select = c(-cigarrets, -depression))
subset(exampleAB, cases = c(Karolina, Johanna))
subset(exampleA1B1A2B2, phase %in% c("A1", "B2"), cases = Pawel:Moritz)

jazznbass/scan documentation built on Sept. 14, 2024, 8:53 a.m.