title: Setting and calling a value as a filename in R
body: <p>What I want to do is to set a value in R called "filename", with the content being the first part of a filename.</p>
  
  <blockquote>
    <p>filename &lt;- "E14_AD_4hr_"</p>
  </blockquote>
  
  <p>I then want to use this 'filename' value to both name and call vectors that will be created through an R script.</p>
  
  <p>Using the bash $ , the syntax would look something like this:</p>
  
  <blockquote>
    <p>filename &lt;- "E14_AD_4hr_"</p>
    
    <p>$filename_Asz1 &lt;- read.table("~/Documents/1608_10_MiSeq/untitled folder 2/E14-AD-4_S20_L001/Filtered_by_quality/E14-AD-4_S20_L001_Asz1/methylation.tsv", quote="\"", comment.char="")
    etc.</p>
  </blockquote>
  
  <p>But this only gives me an error in R.</p>
  
  <p>To get it to run the script correctly, I have to enter the first part of the filenames manually, which is a pain and very inelegant (there's more to the script, but I've only posted the first line).</p>
  
  <blockquote>
    <p>E14_AD_4hr_Asz1 &lt;- read.table("~/Documents/1608_10_MiSeq/untitled folder 2/E14-AD-4_S20_L001/Filtered_by_quality/E14-AD-4_S20_L001_Asz1/methylation.tsv", quote="\"", comment.char="")</p>
  </blockquote>
  
  <p>Basically what I'm asking is does anyone know the correct syntax to set and call a name in this way, in R?</p>
  
  <p>Thanks.</p>