I am using the phylosmith package to make ordination plots from my phyloseq file (microbial ecology data).
Here's the command: nmds_phyloseq(pseq, c("Description"), circle = TRUE, verbose = FALSE)
I get the error:
Error in stat_ellipse()
:
! Problem while computing stat.
ℹ Error occurred in the 1st layer.
Caused by error in compute_layer()
:
! stat_ellipse()
requires the following missing aesthetics: x and y
Run rlang::last_trace()
to see where the error occurred.
rlang::last_trace() <error/rlang_error> Error in
stat_ellipse()
: ! Problem while computing stat. ℹ Error occurred in the 1st layer. Caused by error incompute_layer()
: !stat_ellipse()
requires the following missing aesthetics: x and y
Backtrace: ▆
- ├─base (local)
<fn>
(x) - └─ggplot2:::print.ggplot(x)
- ├─ggplot2::ggplot_build(x)
- └─ggplot2:::ggplot_build.ggplot(x)
-
└─ggplot2:::by_layer(...)
-
├─rlang::try_fetch(...)
-
│ ├─base::tryCatch(...)
-
│ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
-
│ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
-
│ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
-
│ └─base::withCallingHandlers(...)
-
└─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
-
└─l$compute_statistic(d, layout)
-
└─ggplot2 (local) compute_statistic(..., self = self)
-
└─self$stat$compute_layer(data, self$computed_stat_params, layout)
-
└─ggplot2 (local) compute_layer(..., self = self)
I really don't understand what is not working here. I tried giving values to x and y, without success. (It tells me Error in nmds_phyloseq(pseq_relab, c("Description"), x = 1, y = 2, circle = TRUE, : unused arguments (x = 1, y = 2))
The pcoa_phyloseq function of the same package works perfectly on my data (code below) pcoa_phyloseq(pseq, c("Description"), x = 1, y = 2, method = 'bray', circle = 0.95, colors = colours, labels = NULL)
Any idea of what is going wrong and how I could solve this issue?