text: user14429: I am doing scRNAseq analysis with Seurat.
  I clustered the cells using the FindClusters() function.
  What I want to do is to export information about which cells belong to which clusters to a CSV file.
  In a Seurat object, we can show the cluster IDs by using Idents(・), but I have no idea how to export this to CSV files.
  I would be grateful if you could show this by using the PMBC data (https://satijalab.org/seurat/articles/pbmc3k_tutorial.html) as an example.
  
  user73: I've recently done this with my own Seurat data; here's the process:
  # load tidyverse packages
  library(tidyverse)
  # create cluster ID table
  tibble(cellID = colnames(pbmc), clusterID = Idents(pbmc)) %>%
    # write out to a file, with today's date
    write_csv(file = sprintf("cluster_mappings_%s.csv", Sys.Date()))
  
  
  user3631: The clusters information, together with additional information on each cells (%mito, sample name, group, orig.ident,...) are stored inside seuratObject@meta.data.
  write.csv(seuratObject@meta.data,"./seurat_metadata.csv") will dump everything to a file.
  The method @osmoc suggested, is using built in seurat functions to interact with seuratObject@meta.data.
  seuratObject$graph_name_resolution points to seuratObject@meta.data$graph_name_resolution.
  I personally prefer to use the metadata table, as I have more control on how I interact with the data.
  
original_text: 14429: <p>I am doing scRNAseq analysis with Seurat.</p>
  <p>I clustered the cells using the FindClusters() function.</p>
  <p>What I want to do is to export information about which cells belong to which clusters to a CSV file.</p>
  <p>In a Seurat object, we can show the cluster IDs by using Idents(・), but I have no idea how to export this to CSV files.</p>
  <p>I would be grateful if you could show this by using the PMBC data (<a href="https://satijalab.org/seurat/articles/pbmc3k_tutorial.html" rel="nofollow noreferrer">https://satijalab.org/seurat/articles/pbmc3k_tutorial.html</a>) as an example.</p>
   73: <p>I've recently done this with my own Seurat data; here's the process:</p>
  <pre><code># load tidyverse packages
  library(tidyverse)
  # create cluster ID table
  tibble(cellID = colnames(pbmc), clusterID = Idents(pbmc)) %&gt;%
    # write out to a file, with today's date
    write_csv(file = sprintf(&quot;cluster_mappings_%s.csv&quot;, Sys.Date()))
  </code></pre>
   3631: <p>The clusters information, together with additional information on each cells (%mito, sample name, group, orig.ident,...) are stored inside <code>seuratObject@meta.data</code>.
  <code>write.csv(seuratObject@meta.data,&quot;./seurat_metadata.csv&quot;)</code> will dump everything to a file.</p>
  <p>The method @osmoc suggested, is using built in seurat functions to interact with <code>seuratObject@meta.data</code>.
  <code>seuratObject$graph_name_resolution</code> points to <code>seuratObject@meta.data$graph_name_resolution</code>.</p>
  <p>I personally prefer to use the metadata table, as I have more control on how I interact with the data.</p>
  