subset.hyperframe | R Documentation |
Given a hyperframe, return the subset specified by imposing a condition on each row, and optionally by choosing only some of the columns.
## S3 method for class 'hyperframe'
subset(x, subset, select, ...)
x |
A hyperframe pattern (object of class |
subset |
Logical expression indicating which points are to be kept.
The expression may involve the names of columns of |
select |
Expression indicating which columns of marks should be kept. |
... |
Arguments passed to |
This is a method for the generic function subset
.
It extracts the subset of rows of x
that satisfy the logical expression
subset
, and retains only the columns of x
that are
specified by the expression select
. The result is always a
hyperframe.
The argument subset
determines the subset of rows that
will be extracted. It should be a logical expression.
It may involve the names of columns of x
.
The default is to keep all points.
The argument select
determines which columns of x
will be retained.
It should be an expression involving the names of columns
(which will be interpreted as integers representing the positions of
these columns). For example if there are columns named
A
to Z
, then select=D:F
is a valid expression
and means that columns D
, E
and F
will be
retained. Similarly select=-(A:C)
is valid and means that columns
A
to C
will be deleted.
The default is to retain all columns.
Setting subset=FALSE
will remove all the rows.
Setting select=FALSE
will remove all the columns.
The result is always a hyperframe.
A hyperframe.
, \rolf
and \ege
subset
,
[.hyperframe
a <- subset(flu, virustype=="wt")
aa <- subset(flu, minnndist(pattern) > 10)
aaa <- subset(flu, virustype=="wt", select = -pattern)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.