The function droplevels is used to drop unused levels from a factor or, more commonly, from factors in a data frame.

# S4 method for Ranges
droplevels(x)

# S4 method for SummarizedExperiment
droplevels(x)

Arguments

x

Object.

Value

Modified object.

Note

Updated 2019-08-19.

Examples

data(RangedSummarizedExperiment, package = "acidtest") ## Ranges ==== rse <- RangedSummarizedExperiment object <- SummarizedExperiment::rowRanges(rse) droplevels(object)
#> GRanges object with 500 ranges and 8 metadata columns: #> seqnames ranges strand | broadClass #> <Rle> <IRanges> <Rle> | <Rle> #> gene001 X 100627109-100639991 - | coding #> gene002 X 100584802-100599885 + | coding #> gene003 20 50934867-50958555 - | coding #> gene004 1 169849631-169894267 - | coding #> gene005 1 169662007-169854080 + | coding #> ... ... ... ... . ... #> gene496 13 20567069-20691437 + | coding #> gene497 16 5033960-5087379 + | coding #> gene498 12 122471600-122501073 - | coding #> gene499 7 151212490-151227230 - | coding #> gene500 7 151232489-151238827 + | coding #> description #> <Rle> #> gene001 tetraspanin 6 [Source:HGNC Symbol;Acc:HGNC:11858] #> gene002 tenomodulin [Source:HGNC Symbol;Acc:HGNC:17757] #> gene003 dolichyl-phosphate mannosyltransferase subunit 1, catalytic [Source:HGNC Symbol;Acc:HGNC:3005] #> gene004 SCY1 like pseudokinase 3 [Source:HGNC Symbol;Acc:HGNC:19285] #> gene005 chromosome 1 open reading frame 112 [Source:HGNC Symbol;Acc:HGNC:25565] #> ... ... #> gene496 intraflagellar transport 88 [Source:HGNC Symbol;Acc:HGNC:20606] #> gene497 ALG1, chitobiosyldiphosphodolichol beta-mannosyltransferase [Source:HGNC Symbol;Acc:HGNC:18294] #> gene498 zinc finger CCHC-type containing 8 [Source:HGNC Symbol;Acc:HGNC:25265] #> gene499 ATP binding cassette subfamily F member 2 [Source:HGNC Symbol;Acc:HGNC:71] #> gene500 chondroitin polymerizing factor 2 [Source:HGNC Symbol;Acc:HGNC:29270] #> entrezID geneBiotype geneID geneIDVersion geneName #> <list> <Rle> <Rle> <Rle> <Rle> #> gene001 7105 protein_coding ENSG00000000003 ENSG00000000003.14 TSPAN6 #> gene002 64102 protein_coding ENSG00000000005 ENSG00000000005.5 TNMD #> gene003 8813 protein_coding ENSG00000000419 ENSG00000000419.12 DPM1 #> gene004 57147 protein_coding ENSG00000000457 ENSG00000000457.13 SCYL3 #> gene005 55732 protein_coding ENSG00000000460 ENSG00000000460.16 C1orf112 #> ... ... ... ... ... ... #> gene496 8100 protein_coding ENSG00000032742 ENSG00000032742.17 IFT88 #> gene497 56052 protein_coding ENSG00000033011 ENSG00000033011.11 ALG1 #> gene498 55596 protein_coding ENSG00000033030 ENSG00000033030.13 ZCCHC8 #> gene499 10061 protein_coding ENSG00000033050 ENSG00000033050.8 ABCF2 #> gene500 54480 protein_coding ENSG00000033100 ENSG00000033100.16 CHPF2 #> seqCoordSystem #> <Rle> #> gene001 chromosome #> gene002 chromosome #> gene003 chromosome #> gene004 chromosome #> gene005 chromosome #> ... ... #> gene496 chromosome #> gene497 chromosome #> gene498 chromosome #> gene499 chromosome #> gene500 chromosome #> ------- #> seqinfo: 423 sequences from GRCh38 genome
## SummarizedExperiment ==== object <- RangedSummarizedExperiment