[.lcens | R Documentation |
Extracts or subsets a vector: methods for "lcens," "mcens," and "qw" data.
## S3 method for class 'lcens' x[i, ...] ## S3 method for class 'mcens' x[i, ...] ## S3 method for class 'qw' x[i, ...] ## S3 method for class 'qw' subset(x, subset, ...)
x |
any R object to subset. |
i |
index specifying elements to extract. |
... |
not used, required for other methods. |
subset |
an logical expression involving a slot name of the qw object. |
The values for i
can be either numeric indexes or logical.
Valid slot names are "remark.codes," "reporting.level," "reporting.method,"
"reporting.units," "analyte.method," "analyte.name," and "unique.code."
A subset of the object x
.
In general, assignment of specific values should not be done using the
"[" extraction operator because it does not modify the meta data assiciated
with a value. But any value can be set to NA
by treating the value as
a matrix and setting the equivalent of the row to NA
. See the example below.
[.qw
Xcens <- as.lcens(c(1, 2, 3, 4), 2) # Extract the 3rd value Xcens[3] # Change the 3rd value to NA and print the data Xcens[3,] <- NA Xcens
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.