move_label | R Documentation |
Moves a factor level in a psmelt dataframe to the desired position.
move_label(psdf, col_name, label = "Other", pos = 0)
psdf |
A psmelt dataframe |
col_name |
The name of the factor column |
label |
The factor level to be moved |
pos |
The position to move the level to. |
A data.frame
data(GlobalPatterns)
# Move "Other" to position 0
top <- top_taxa(GlobalPatterns)
psdf <- psmelt(top$ps_obj)
psdf <- move_label(psdf, col_name = "Phylum", label = "Other", pos = 0)
levels(psdf$Phylum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.