title: Error in converting a .rds file into .csv
body: <p>I received two .rds files - which contains 2 data frames - to be converted into .csv or .dta files. Therefore, I firstly simply opened the .rds using the following:</p>
  <pre><code>file1 &lt;- readRDS(&quot;~/Desktop/f1.rds&quot;)
  </code></pre>
  <p>However, when trying to convert into .csv with</p>
  <pre><code>write.csv(file1, &quot;~/Desktop/file1.csv&quot;)
  </code></pre>
  <p>I obtain the following error:</p>
  <pre><code>Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 
  cannot coerce class ‘c(&quot;survey.design2&quot;, &quot;survey.design&quot;)’ to a data.frame
  </code></pre>
  <p>How can I set the object from .rds into a data frame and/or directly convert into csv? What is causing the problem?</p>
  <p>Thanks for your help</p>