Exporting data/graphs

In the previous section, we learned how to import data from external files. Now, there will be many instances where we would be keen to export data from R into suitable foreign files. The need may arise in automated systems, reporting, and so on, where the other software requires making good use of the R output.

Exporting R objects

The basic R function that exports data is write.table, which is not surprising as we saw the utility of the read.table function. The following screenshot gives a snippet of the write.table function. While reading, we assign the imported file to an R object, and when exporting, we first specify the R object and then mention the filename. By default, R assigns row names while exporting the object. ...

Get Statistical Application Development with R and Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.