error with plot

37 views
Skip to first unread message

Lynne Itelson

unread,
Oct 24, 2022, 4:27:14 PM10/24/22
to ggplot2

Hi,
I ran the following code and at the end got the next error:

error_ggplot2.JPG

what might be the problem?

Thank you!

Lynne

`library(microbiome)
#plot_count_abundance
library(phyloseq)
library(ggplot2)

#check how many samples are there

total_samples <- phyloseq::nsamples(ps)
ps.pruned <- prune_taxa(taxa_sums(ps) >0, ps)

merge all taxa that are detected rare

pseq.phylum <- aggregate_rare(ps, level="Phylum", detection = 1/100, prevalence = 50/100)

Remove the "p__" before the family names

taxa_names(pseq.phylum) <- gsub("p__", "", taxa_names(pseq.phylum) )

p.phylum <- plot_composition(ps.pruned,
sample.sort = NULL,
otu.sort = NULL,
x.label = "empo_3",
plot.type = "barplot",
verbose = FALSE) +
theme(axis.text.x = element_blank(),
axis.ticks = element_blank()) +
xlab("Bacteria composition")

p.phylum
`

Robert Winkelman

unread,
Oct 26, 2022, 10:32:12 AM10/26/22
to ggplot2
Can you send me the R used to install those packages? 
Reply all
Reply to author
Forward
0 new messages