Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve factor level order when creating sample_data #406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raivokolde
Copy link

I just started using phyloseq and it is great! However, I was slightly annoyed that sample_data() changed the ordering of the factor levels. These play important role in drawing plots with ggplot2, so I decided to create a quick fix for the problem. There I drop unused levels but the order of remaining ones stays the same.

@joey711
Copy link
Owner

joey711 commented Apr 1, 2018

The better fix for this would be to use the canonical droplevels method:

https://stat.ethz.ch/R-manual/R-devel/library/base/html/droplevels.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants