Extract.rle | R Documentation |
rle
ObjectsThese methods are defined and produce an error (except
for character
input) to future-proof code that depends on the
rle
package by preventing their use.
## S3 method for class 'rle'
x[i, ...]
## S3 replacement method for class 'rle'
x[i, ...] <- value
## S3 method for class 'rle'
x[[i, ...]]
## S3 replacement method for class 'rle'
x[[i, ...]] <- value
## S3 method for class 'rle'
x$name
## S3 replacement method for class 'rle'
x$name <- value
x , i , name , value , ... |
Arguments to indexing operators. See
Extract documentation in the |
At this time, the rle
package does not support indexing
operations by logical
or numeric
indices, but it is
likely to do so in the future. Therefore, we reserve the syntax
now to prevent users of this package from relying on the default
behaviour of the indexing operators.
At this time, all functions raise an error except for
character
indices. This behaviour can be overridden by
setting options(rle.unclass_index=TRUE)
, which effectively
unclass
es the objects before indexing.
# Indexing by character or by $ works, including sub-indexing.
x <- rle(1:5)
x[["values"]] <- 2:6
x
x$values[2:3] <- 7:8
x
## Not run:
# Numerical indexing doesn't, unless `options(rle.unclass_index=TRUE)` is set.
x[1]
x[[1]]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.