Subset datasets and extract variables
# S4 method for CrunchDataset,ANY,ANY
[(x, i, j, ..., drop = TRUE)# S4 method for CrunchDataset,logical,missing
[(x, i, j, ..., drop = FALSE)
# S4 method for CrunchDataset,character,ANY
[(x, i, j, ..., drop = TRUE)
# S4 method for CrunchDataset,VariableGroup,ANY
[(x, i, j, ..., drop = TRUE)
# S4 method for CrunchDataset,VariableOrder,ANY
[(x, i, j, ..., drop = TRUE)
# S4 method for CrunchDataset,missing,ANY
[(x, i, j, ..., drop = FALSE)
# S4 method for CrunchDataset,CrunchLogicalExpr,missing
[(x, i, j, ...,
drop = FALSE)
# S4 method for CrunchDataset,CrunchLogicalExpr,ANY
[(x, i, j, ..., drop = FALSE)
# S4 method for CrunchDataset
subset(x, ...)
# S4 method for CrunchDataset,ANY
[[(x, i, ..., drop = FALSE)
# S4 method for CrunchDataset,character
[[(x, i, ..., drop = FALSE)
# S4 method for CrunchDataset
$(x, name)
a CrunchDataset
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.
columnar extraction, as described above
additional arguments
logical: autmatically simplify a 1-column Dataset to a Variable? Default is FALSE, and the TRUE option is in fact not implemented.
columnar extraction for $
[
yields a Dataset; [[
and $
return a Variable