0

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 in compute_layer(): ! stat_ellipse() requires the following missing aesthetics: x and y

Backtrace: ▆

  1. ├─base (local) <fn>(x)
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─ggplot2:::by_layer(...)
    
  6.   ├─rlang::try_fetch(...)
    
  7.   │ ├─base::tryCatch(...)
    
  8.   │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    
  9.   │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    
  10.   │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
    
  11.   │ └─base::withCallingHandlers(...)
    
  12.   └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
    
  13.     └─l$compute_statistic(d, layout)
    
  14.       └─ggplot2 (local) compute_statistic(..., self = self)
    
  15.         └─self$stat$compute_layer(data, self$computed_stat_params, layout)
    
  16.           └─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?

0 Answers0