title: R. Error with read.table and paste(). Function is sticking FALSE from stringsAsFactors = F to object
body: <p>I have a directory in an external hard disk, Apple laptop:</p>
  
  <pre><code>setwd("/Volumes/HD/1000Genomes/phased_IMPUTE2")
  </code></pre>
  
  <p>I want to run a for loop with some files:</p>
  
  <pre><code>for(i in 1:22) {
     infile1 &lt;-
  paste("chr",i,"_cancer.impute.hap",
                  sep="", stringsAsFactors = F) # 
     infile2 &lt;- 
  paste("chr",i,"_cancer.impute.legend",
                  sep="", header = T, stringsAsFactors = F)
  
     outfile &lt;- 
  paste("chr",i,"_cancer_phased.txt",sep=" ")
  
     hap &lt;- read.table(infile1)
     leg &lt;- read.table(infile2)
  
     # Perform more tasks...
  
   }
  </code></pre>
  
  <p>However, I get the following message:</p>
  
  <pre><code>Error in file(file, "rt") : cannot open the connection
  In addition: Warning message:
  In file(file, "rt") :
    cannot open file 
  'chr1_cancer_impute.hapFALSE': No such file or 
  directory
  </code></pre>
  
  <p>It seems the paste() function is pasting the "FALSE" of stringsAsFactors = F. I must be doing some very silly mistake. Does anybody know what it is happening?. Thanks very much</p>