Description Usage Arguments Details Value Author(s) References See Also Examples
Tables can be repetitive for structural reasons. Repetition means, for instance,
that a column value is not changing (i.e., is static) with respect to rows.
The data.frame
method for static
detects which columns (maybe all)
are static with respect to on
; it returns a unique subset of rows for just
those columns. The method for keyed
returns by default the columns that are
static on the key (i.e., static with respect to the key). static
is conceptually
related to constant
, which returns a logical rather than a data subset.
It is possible also to retrieve just the dynamic part of the data set, or both.
Currently, the work is done by lyse.data.frame
which returns both and is
called in turn by static.data.frame
and dynamic.data.frame
.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S3 method for class 'data.frame'
static(x,on=character(0),strict=TRUE, ...)
## S3 method for class 'keyed'
static(x,on=key(x),...)
## S3 method for class 'data.frame'
dynamic(x,on=character(0),strict=TRUE, ...)
## S3 method for class 'keyed'
dynamic(x,on=key(x),...)
## S3 method for class 'data.frame'
lyse(x,on=character(0),strict=TRUE, ...)
## S3 method for class 'keyed'
lyse(x,on=key(x),...)
|
x |
object of dispatch |
on |
character vector: column names in x |
strict |
boolean: if false, NA's will be imputed within levels of |
... |
ignored |
By default, the data.frame
method just returns unique rows for columns
that are constant across the entire data.frame.
If on
names columns in x
, those columns are retained,
and other columns are retained only if
their values are static within combinations of values in the implied key; again,
unique rows are returned. By default, the keyed
method makes the
key explicit; it will be a non-operation if keys are defined and non-duplicated
(i.e., all non-key columns are unique and therefore constant within the key,
so the whole data.frame is returned). In all cases, the result is coerced with
as.keyed
, using on
as the key (even if length zero).
keyed data.frame; for lyse.data.frame
, a list with elements static
and dynamic
.
Tim Bergsma
http://metrumrg.googlecode.com
constant
as.keyed
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.