title: Writing files with different( unique) name
body: <p><strong>Possible Duplicate:</strong> <a href="https://stackoverflow.com/questions/4675755/how-to-save-with-a-particular-variable-name">how to save() with a particular variable name</a></p>
  
  <p>I need to write the output of my code, which generates some 200 files of 50k*4. I want to know if i can write each individual file with a different name in my working directory. Right now the maximum i can do is to save one file by using the code : </p>
  
  <p><code>write.table(filename,"name.csv")</code> or <code>write.csv()</code>. </p>
  
  <p>On saving if the file with the same name exists, throw a warning and save it with a different name. Is there a way??</p>
  
  <p>Edited : some code is here. Each time a file is generated, i want to write it with a unique name.</p>
  
  <pre><code>      affy.data = ReadAffy()
        for(i in 1: length(affy.data))
        {
  
         eset.mas5 = mas5(affy.data[,i])
  
      ## getting the expression matrix (probesets/genes in rows, chips in columns).
      exprSet.nologs = exprs(eset.mas5)
  
      ## At this time let's log-transform the expression values to get a more normal distribution. 
      ## We have to remember we've done this when we calculate ratios. Logarithms can use any
      ## base, but base 2 is easiest when transforming ratios, since transformed 2-fold
      ## ratios up or down will be +1 or -1. As a result, we'll do all logs with base
      ## 2 to keep thing simplest.
      #exprSet = log(exprSet.nologs, 2)
  
  
      ## While we're doing Affymetrix-specific preprocessing, let's calculate an Absent/Present call for each probeset.
      # Run the Affy A/P call algorithm on the CEL files we processed above
      data.mas5calls = mas5calls(affy.data[,i])
  
      # Get the actual A/P calls
      data.mas5calls.calls = exprs(data.mas5calls)
  
      ## Getting pvalue
      pvalue &lt;- assayData(data.mas5calls)[["se.exprs"]]
  
      ## Combining data
      data.full &lt;- cbind(exprSet.nologs,data.mas5calls.calls,pvalue)
      colnames(data.full) &lt;- c("VALUE","ABS_CALL","DETECTION P-VALUE")
      print(head(data.full,20))
      write.table(data.full, file="1.txt", quote=F, sep="\t")
      }
  </code></pre>