Open slambrechts opened 3 years ago
@slambrechts
Based on the information provided in NEWS, the function was removed since v0.99.44
However, you can change the method=
argument in the ordinate
function to perform ordination with CCA, for example:
library(phyloseq)
data(GlobalPatterns)
# prune OTUs that are not present in at least one sample
GP = prune_taxa(taxa_sums(GlobalPatterns) > 0, GlobalPatterns)
# Use ordinate to call vegan::cca()
cca1 <- ordinate(GP, method = "CCA", formula = ~ SampleType)
# Use vegan::cca() directly
cca2 <- vegan::cca(t(otu_table(GP)) ~ SampleType, data = data.frame(sample_data(GP)))
Both will give you the same results:
Inertia Proportion Rank
Total 11.4664 1.0000
Constrained 6.8297 0.5956 8
Unconstrained 4.6367 0.4044 17
Inertia is scaled Chi-square
Eigenvalues for constrained axes:
CCA1 CCA2 CCA3 CCA4 CCA5 CCA6 CCA7 CCA8
0.9800 0.9369 0.9226 0.8937 0.8568 0.8411 0.7659 0.6326
Eigenvalues for unconstrained axes:
CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8
0.6062 0.6026 0.5856 0.5028 0.4971 0.3626 0.3551 0.2524
(Showing 8 of 17 unconstrained eigenvalues)
@ycl6 Can you use this code with multiple predictors?
@pauGuas You can have more than one predictors in the model formula, but obviously the analysis will become more complex and less likely to detect strong relationships the more you include. You can read the cca
manual here, and future question on vegan
's features is more appropriate in its GitHub page.
Hi,
When running
cca.phyloseq(physeq_CSS, formula = physeq_CSS ~ Bedrock + dem + pH_dest + TOC + N.NH4 + N_NO3 + P_PO4 + TN_perc + TP_perc + conductivity, method = "RDA")
I get:
could not find function "cca.phyloseq"
I could however find the function in the help pages. Any idea what is causing this?