droplevels2 | R Documentation |
Drop factor levels
droplevels2(x, ...)
## S4 method for signature 'DFrame'
droplevels2(x)
## S4 method for signature 'Ranges'
droplevels2(x)
## S4 method for signature 'Rle'
droplevels2(x)
## S4 method for signature 'data.frame'
droplevels2(x)
## S4 method for signature 'factor'
droplevels2(x)
x |
Object. |
... |
Additional arguments. |
Modified object.
Updated 2023-09-12.
data(GRanges, package = "AcidTest")
## Ranges ====
object <- GRanges
object <- droplevels2(object)
print(object)
## Rle ====
object <- factor(c("a", "a", "b", "b"), levels = c("a", "b", "c"))
object <- S4Vectors::Rle(object)
print(object)
object <- droplevels2(object)
print(object)
## factor ====
object <- factor(c("a", "a", "b", "b"), levels = c("a", "b", "c"))
print(object)
object <- droplevels2(object)
print(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.