Learn R Programming

crunch (version 1.14.4)

dataset-extract: Subset datasets and extract variables

Description

Subset datasets and extract variables

Usage

"["(x, i, j, ..., drop = TRUE)
"["(x, i, j, ..., drop = FALSE)
"["(x, i, j, ..., drop = TRUE)
"["(x, i, j, ..., drop = TRUE)
"["(x, i, j, ..., drop = TRUE)
"["(x, i, j, ..., drop = FALSE)
"["(x, i, j, ..., drop = FALSE)
"["(x, i, j, ..., drop = FALSE)
"subset"(x, ...)
"[["(x, i, ..., drop = FALSE)
"[["(x, i, ..., drop = FALSE)
"$"(x, name)

Arguments

x
a CrunchDataset
i
As with a data.frame, there are two cases: (1) if no other arguments are supplied (i.e x[i]), i provides for as.list extraction: columns of the dataset rather than rows. If character, identifies variables to extract based on their aliases (by default: set options(crunch.namekey.dataset="name") to use variable names); if numeric or logical, extracts variables accordingly. Alternatively, (2) if j is specified (as either x[i, j] or x[i,]), i is an object of class CrunchLogicalExpr that will define a subset of rows.
j
columnar extraction, as described above
...
additional arguments
drop
logical: autmatically simplify a 1-column Dataset to a Variable? Default is FALSE, and the TRUE option is in fact not implemented.
name
columnar extraction for $

Value

[ yields a Dataset; [[ and $ return a Variable