Skip to content

Unable to change levels of group variable in plot_paired_abundances #184

@mariamaseng

Description

@mariamaseng

Hi!
I want to plot_paired_abundances, and are successfully able. However, i would like to change the levels of the group (currently they are post-pre, want it to be pre-post). When I do with this code:
sample_data(p_kombucha_agg)$pre_post <- factor(sample_data(p_kombucha_agg)$pre_post, levels=c('pre', 'post'))
it changes from being a character to a factor. Then running the code I get the following error message (which seem unrelated to the actual problem).

_Error in filter():
! Problem while computing ..1 = group == unique(xmeta_lf_2$group)[1].
✖ Input ..1 must be of size 6 or 1, not size 0.
ℹ The error occurred in group 1: taxa = "d__Bacteria;p__Firmicutes;c__Bacilli;o__Bacillales_B;f__Bacillaceae_C;g__Weizmannia", linevar = 2003.
Backtrace:

  1. microbiomeutilities::plot_paired_abundances(...)
  2. dplyr:::filter.data.frame(., group == unique(xmeta_lf_2$group)[1])_

My question; how can I change the levels of my group variable?
Thanks for a great package!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions