Hey guys,
I'm trying to use qza files to generate alpha diversity graphics from qiime2 to R but this part is returning an error:
adiv <- data.frame("observed_features" = read_qza("../core-metrics-results/observed_features_vector.qza")$data,
"shannon" = read_qza("../core-metrics-results/shannon_vector.qza")$data,
"evenness" = read_qza("../core-metrics-results/evenness_vector.qza")$data,
"faith_pd" = read_qza("../core-metrics-results/faith_pd_vector.qza")$data$V2,
"chao1" = read_qza("../core-metrics-results/chao1_vector.qza")$data,
"simpson" = read_qza("../core-metrics-results/simpson_vector.qza")$data,
"Status" = phyloseq::sample_data(ps)$Treatment,
check.names = FALSE)
colnames(adiv) <- c("Observed", "Shannon", "Evenness", "Faith_pd", "Chao1", "Simpson", "Group")
head(adiv)
The following error is returned:
Error in data.frame(observed_features = read_qza("..t/core-metrics-results/observed_features_vector.qza")$data, :
arguments imply differing number of rows: 77, 79
Although, I already saw the number of rows and lines and they are exactly the same (except for faith pdf, which is why when reading the dataframe it is used only column 2 by "$data$V2" option.
So I don't know what it can be or how to fix this..
nrow(observed_features_data)
[1] 77
length(observed_features_data)
[1] 1
nrow(shannon_vector)
[1] 77
length(shannon_vector)
[1] 1
nrow(evenness)
[1] 77
length(evenness)
[1] 1
nrow(faith_pd)
[1] 77
length(faith_pd)
[1] 2
nrow(chao1)
[1] 77
length(chao1)
[1] 1
nrow(simpson)
[1] 77
length(simpson)
[1] 1