metacoder
metacoder copied to clipboard
Error for running alpha diversity analysis
I tried to run alpha diversity analysis from https://grunwaldlab.github.io/metacoder_documentation/workshop--07--diversity_stats.html, and test below codes: library(vegan) sample_data$alpha <- diversity(obj$data$otu_rarefied[, sample_data$SampleID], MARGIN = 2, index = "invsimpson") hist(sample_data$alpha)
It returned such error:
Error: Corrupt grouped_df
using old (< 0.8.0) format.
ℹ Strip off old grouping with ungroup()
.
Run rlang::last_error()
to see where the error occurred.
rlang::last_trace() <error/rlang_error> Corrupt
grouped_df
using old (< 0.8.0) format. ℹ Strip off old grouping withungroup()
. Backtrace: █
- ├─base::
$<-
(...) - └─dplyr:::
$<-.grouped_df
(...) - ├─name %in% group_vars(x)
- ├─dplyr::group_vars(x)
- └─dplyr:::group_vars.data.frame(x)
-
├─generics::setdiff(names(group_data(x)), ".rows")
-
├─dplyr::group_data(x)
-
└─dplyr:::group_data.grouped_df(x)
-
└─dplyr::validate_grouped_df(.data)
I do not get that error when I tried it just now. Try downloading "clean_data.Rdata" again and to make sure it is the updated version and try the code again.
I also got this error right now
I am still not getting this error:
load("~/Downloads/clean_data.Rdata")
library(vegan)
#> Loading required package: permute
#> Loading required package: lattice
#> This is vegan 2.6-4
sample_data$alpha <- diversity(obj$data$otu_rarefied[, sample_data$SampleID],
MARGIN = 2,
index = "invsimpson")
hist(sample_data$alpha)
Created on 2023-09-05 with reprex v2.0.2
Can someone send me the URL to the "clean_data.Rdata" file they are using (or attach it) and their sessionInfo? Thanks
Hello,
I am also having exactly the same issue.
Have you found a solution for this?
Thanks,
KY
I have not been able to reproduce the problem. Until I can do that, there is very little hope of fixing the issue. Can you send me the URL to the "clean_data.Rdata" file you are using (or attach it) and your sessionInfo? Thanks
Thank you for your quick response! I downloaded from the link below.
https://grunwaldlab.github.io/analysis_of_microbiome_community_data_in_r/07--diversity_stats.html
Ahh, ok, that was the original website for the workshop, but we have been keeping an updated version here:
https://grunwaldlab.github.io/metacoder_documentation/workshop--00--introduction.html
I thought that website had been taken down actually. I will replace it with a link to the current location
Thanks! Glad that it's solved.