Skip to contents

Drop factor levels

Usage

droplevels2(x, ...)

# S4 method for DataFrame
droplevels2(x)

# S4 method for Ranges
droplevels2(x)

Arguments

x

Object.

...

Additional arguments.

Value

Modified object.

Note

Updated 2022-04-25.

Examples

data(GenomicRanges, package = "AcidTest")

## Ranges ====
object <- GenomicRanges
object <- droplevels2(object)
print(object)
#> GRanges object with 5 ranges and 2 metadata columns:
#>                   seqnames              ranges strand |          geneId
#>                      <Rle>           <IRanges>  <Rle> |           <Rle>
#>   ENSG00000000003        X 100627109-100639991      - | ENSG00000000003
#>   ENSG00000000005        X 100584802-100599885      + | ENSG00000000005
#>   ENSG00000000419       20   50934867-50958555      - | ENSG00000000419
#>   ENSG00000000457        1 169849631-169894267      - | ENSG00000000457
#>   ENSG00000000460        1 169662007-169854080      + | ENSG00000000460
#>                   geneName
#>                      <Rle>
#>   ENSG00000000003   TSPAN6
#>   ENSG00000000005     TNMD
#>   ENSG00000000419     DPM1
#>   ENSG00000000457    SCYL3
#>   ENSG00000000460 C1orf112
#>   -------
#>   seqinfo: 357 sequences (1 circular) from GRCh38 genome