title: Trying to generate ASV table from phyloseq
body: <p>I recognize most people have the opposite problem. But I'm trying to create an ASV table, with column names as &quot;identified OTUs&quot; (aka the column name is drawn from the taxonomy information from <code>GlobalPatterns@tax.table</code>, rather than just being the assigned OTU code that's encoded in <code>GlobalPatterns@otu.table</code>), and row names as sample name.</p>
  <p>I also want to append the metadata to the end of the ASV table, to allow for analysis based on said metadata.</p>
  <p>I managed to generate a table <em>without</em> the taxonomic information with this code, using GlobalPatterns for reproducibility:</p>
  <pre><code>data(GlobalPatterns)
  asv.matrix &lt;- as.matrix(GlobalPatterns@otu_table@.Data)
  asv &lt;- data.frame(t(asv.matrix))                                   #transposing to make sample name the row name
  meta.df &lt;- as.data.frame(GlobalPatterns@sam_data)
  asv.full &lt;- data.frame(asv,meta.df)
  write.csv(asv.full, file = &quot;full_asv.csv&quot;,quote = FALSE,sep = &quot;,&quot;)
  </code></pre>
  <p>However, I can't figure out how to force taxonomy information into the column names, which makes the ASV table functionally useless for analysis.</p>
  <p>EDIT:
  My preferred format is (abbreviated with faked metadata appended) as below. Tried to make a table, failed, have a fake code chunk.</p>
  <pre><code>Sample-ID / Species1 / Species2 / ...etc... / Metadata1 / Metadata2 /...etc... /
  --------- / -------- / -------- / --------- / --------- / --------- /--------- /
  Sample1   / 1        / 5        / ...etc... / lake      / summer    /...etc... /
  Sample2   / 4        / 0        / ...etc... / bog       / spring    /...etc... /
  </code></pre>