Answers.Body: <p>You could convert the phyloseq object to a dataframe and just plot it using base R or ggplot2. I'm not exactly sure what the bray curtis df will be called but you can access it using the @ notation then convert with data.frame e.g.</p>
  <pre><code>bray_for_plot &lt;- data.frame(phylo_obj@bray)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-29T07:10:42.130Z
Answers.LastActivityDate: 2020-07-29T07:10:42.130Z
Answers.UserDisplayName: adamsorbie
Body: <p>I am working with profiled metagenomic taxonomy abundance data. I want to generate beta diversity (bray-curtis) boxplot from a phyloseq object where two groups (control and test) will be shown. Something like this figure:</p>
  <p><a href="https://i.sstatic.net/pgauk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pgauk.png" alt="enter image description here" /></a></p>
  <p>How can I make it? Can anyone share any code or tutorial?</p>
  <p>Thanks,
  dpc</p>
  
Tags: <r>
Title: How to generate Beta diversity boxplot from phyloseq object?
ThreadText: # How to generate Beta diversity boxplot from phyloseq object?
  
  (Asked by: username_0 on 2020-07-27)
  
  I am working with profiled metagenomic taxonomy abundance data. I want to generate beta diversity (bray-curtis) boxplot from a phyloseq object where two groups (control and test) will be shown. Something like this figure:
  
  [![enter image description here](https://i.sstatic.net/pgauk.png)](https://i.sstatic.net/pgauk.png)
  
  How can I make it? Can anyone share any code or tutorial?
  
  Thanks,
  dpc
  
  **Tags:** r
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-29. Score: 1
  
  You could convert the phyloseq object to a dataframe and just plot it using base R or ggplot2. I'm not exactly sure what the bray curtis df will be called but you can access it using the @ notation then convert with data.frame e.g.
  
  ```
  bray_for_plot <- data.frame(phylo_obj@bray)
  
  ```
  
  
  ---
  
  