title: Phyloseq and Heatmap
body: <p>I am analyzing 16s microbiome data from the lung and mouth and I'm basically teaching myself R. So I made it through qiime and have uploaded two files into R. My OTU table using:</p>
  
  <pre><code>otu=import_biom('C:\Users\OneDrive\otu_table.biom')
  </code></pre>
  
  <p>and my sort of "map" file which just contains SampleID, Location, and Paired. For example:</p>
  
  <pre><code> SampleID  Location   Paired
   1_L       Lung       1
   1_M       Mouth      1
   2_L       Lung       2
   2_M       Mouth      2
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>map=read.csv('C:\Users\OneDrive\Mouth vs lung R map_adj.csv',
               header=T,row.name=1,stringsAsFactors=F)
  </code></pre>
  
  <p>My data is paired and I want to compare the lung vs the mouth using a heatmap. I've been having trouble with R. First off it won't let me do it by location. I've tried:</p>
  
  <pre><code>plot_heatmap(otu, sample.label="SampleType")
  </code></pre>
  
  <p>And I got this error:</p>
  
  <pre><code>Error in get_variable(physeq, sample.label) :
  Your phyloseq data object does not have a sample-data component
  Try ?sample_data for more details.
  </code></pre>
  
  <p>I went to <code>?sample_data</code> and I have no idea what I am missing here.</p>
  
  <p>Secondly, I'd like to do it by location and paired if that makes sense.</p>
  
  <p>Can anyone help me with this code and maybe explain what it is I'm missing here, because I also have data where I look at the lung microbiome at baseline and then again 2 months later so that also is paired data.</p>
  
  <p>Thank you for your help!</p>
  
  <p>Here is my whole code:</p>
  
  <pre><code>library("phyloseq")
  packageVersion("phyloseq")
  
  otu=import_biom('C:\Users\closed-ref-33031010\otu_table.biom')
  
  map=read.csv('C:\Users\Qiime Maps\Mouth vs lung R map_adj.csv',
               header=T,row.name=1,stringsAsFactors=F)
  
  sampledata1=sample_data(map)
  
  otu2=merge_phyloseq(otu,sampledata1)
  plot_heatmap(otu2)
  </code></pre>
  
  <p>In addition, I'm unsure how to make a phyloseq object</p>