droplevels2: Drop factor levels

droplevels2R Documentation

Drop factor levels

Description

Drop factor levels

Usage

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)

Arguments

x

Object.

...

Additional arguments.

Value

Modified object.

Note

Updated 2023-09-12.

Examples

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)

acidgenomics/brio documentation built on Feb. 1, 2024, 11:47 a.m.