Description of issue -
I am new using R. I am using phyloseq to analyze microbiome data. I am using plot_bar(physeq, fill = "XXXX") to get the taxonomic plots. The code is working fine but when I try to plot the taxa by class, order, family, genus, or species, the plots are so big that is only shown a part of the legend. I tried to export and zoom by still cannot see the full graph. I also tried to reset the plot setting using:
dev.off()
plot(cars)
but it did not work.
Please could you help me!
library(phyloseq)
library("ggplot2"); packageVersion("ggplot2")
theme_set(theme_bw())
#Import Data
lakewaterdataTG <- import_biom("D:\\SeqData LakeWaterExp\\QIIME v.5 Default Quality by sample Nephele Job 1da5fbcee51a\\outputs\\core_diversity\\taxa_plots_TreatmentGroup\\TreatmentGroup_otu_table.biom")
mapfileTG <- import_qiime_sample_data("D:\\SeqData LakeWaterExp\\QIIME v.5 Default Quality by sample Nephele Job 1da5fbcee51a\\outputs\\core_diversity\\taxa_plots_TreatmentGroup\\TreatmentGroup_map.txt")
lakewaterdataTG <- merge_phyloseq(lakewaterdataTG, mapfileTG)
lakewaterdataTG
#Rename the taxonomic levels
ncol(tax_table(lakewaterdataTG))
colnames(tax_table(lakewaterdataTG)) <- c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species")
#OTU Table and taxa Tables
OTU = otu_table(lakewaterdataTG, taxa_are_rows = TRUE)
TAX = tax_table(lakewaterdataTG)
OTU
# combine them into a phyloseq object
physeq = phyloseq(OTU, TAX)
physeq
dev.off()
plot(cars)
plot_bar(physeq, fill = "Kingdom")
plot_bar(physeq, fill = "Phylum")
plot_bar(physeq, fill = "Class")
plot_bar(physeq, fill = "Order")
plot_bar(physeq, fill = "Family")
plot_bar(physeq, fill = "Genus")
plot_bar(physeq, fill = "Species")
System Information:
- RStudio Edition: (Desktop or Server) Desktop
- RStudio Version: Version 1.1.456 – © 2009-2018 RStudio, Inc.
- OS Version: windows 10 education version 1803 OS build 17134.254
- R Version: R version 3.5.1 (2018-07-02)
-
sessionInfo()
:
Referred here from support.rstudio.com