subsetting/pruning microbial data with physeq
0
0
Entering edit mode
4.0 years ago

Hello,

I'm quite new to R so not sure if this is the right approach. But I have al dataset two types of plant microbiomes: endosphere and phyllosphere microbes. I would like to separate these two so that I can visualize them each individually on a NMDS plot.

However, when I try to prune or subset the samples (like, split the "endo" and "phyllo" to have two subsets that I can plot separately), it doesn't work completely.

My code is:

#preparations
pacman::p_load(vegan, ggplot2, phyloseq)
load("psSIL.rdata")

#subsetting
subset_endo <- subset_samples(psSIL, type=="endo")

#plotting
plot_ordination(subset_endo, ord.nmds.bray, color="type", title="Bray NMDS") + theme_classic() + geom_label(aes(label = 
corresponding_id))

When I execute this, I get a warning:

Warning message: Removed 22 rows containing missing values (geom_label).

And when looking at the NMDS plot, I still see the datapoints of the removed phyllosphere category as "dots" on the plot together with the endo category data. In other words, it is still all on the plot. But I want those removed so that I just see the endo data that I have.

How can I do so that I separate the two types, or remove the phyllo datapoints on the NMDS plot completely?

Thank you!!

subset_samples phyloseq • 630 views
ADD COMMENT

Login before adding your answer.

Traffic: 1842 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6