i

R Programming Complete Tutorial

Export-Import CSV file

A CSV file is a comma-separated values file, which allows data to be saved in a tabular format. CSVs look like a garden-variety spreadsheet but with its own extension (. csv). In this part of the document, we are going to import CSV data sources from different sources, then will analyze these data and finally export data to a new CSV file. 

Manage working directory

First, we will check our current working directory. If we don't feel right about it or don't think it is acceptable, then we can set a working directory according to our choice. We can directly export and import CSV files from the current working directory.

We can check the current working directory using getwd(), and in case of setting a new working directory, we have to use setwd(). We can do the same from the Session menu of R Studio.