KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
66 stars 23 forks source link

amp_ordinate #103

Closed PatoUru closed 3 years ago

PatoUru commented 3 years ago

Hi All! I'm new on R and I'm trying to use amp_ordinate to perform a CCA plot adding the operational data as vectors.
But the following error appear:

Error in [.data.frame(data$metadata, , envfit_factor, drop = FALSE) : undefined columns selected

The metadata (dat) is attached and I run the following envfit_numeric <- factor(dat[, 2:12]) envfit_factor <- factor(dat[, 14:19])

ordinationresult <- amp_ordinate(av2, type = "CCA", constrain = "Season", transform = "Hellinger", sample_color_by = "Season", sample_shape_by = "Reactor", sample_colorframe = TRUE, sample_colorframe_label = "Season", detailed_output = TRUE, species_plot = TRUE, envfit_factor = envfit_factor, envfit_numeric = envfit_numeric, envfit_show = TRUE, filter_species = 0.1)

ordinationresult$plot

I thank you in advance for any suggestions!!

KasperSkytte commented 3 years ago

Hi there. You just need to provide a metadata variable name to the envfit_factor and envfit_numeric arguments. Fx envfit_factor = "Season"