title: how can I make a function to save dataframe
body: <p>I want to make a function to save dataframe, so I coded as below:</p>
  
  <pre><code> save&lt;-function(x)
  {
  write.table(x, file=paste(x,"csv", sep="."))
  write.table(x, file=paste(x,"txt", sep="."))
  }
  </code></pre>
  
  <p>but I got errors:</p>
  
  <pre><code> save(summary1)
  </code></pre>
  
  <blockquote>
    <p>Error in file(file, ifelse(append, "a", "w")) : 
    invalid 'description' argument
    In addition: Warning message:
    In if (file == "") file &lt;- stdout() else if (is.character(file)) { :
      the condition has length > 1 and only the first element will be used</p>
  </blockquote>
  
  <p>what's wrong?</p>