====== Import Data to GNU R ======

This guide describes how to import collected data into [[http://www.r-project.org/|GNU R]], if you have downloaded the data in //GNU R// format as a CSV file as well as a R script (R file) [[download#gnu_r|Downloading Data: GNU R]].

**Note:** If the data and the script were downloaded at different times, it may be that the files are incompatible (e.g. because the list of variables used may have changed).

**Note:** When downloading the survey data, choose the //GNU R// file format instead of //CSV//. This ensures that the formatting in the file will be compatible with the import script.
 
The following steps describe the process when using the RGui user interface for R. In principle, the process is virtually the same if you are using R from the console, or another GUI such as [[http://www.rstudio.com/|RStudio]].

Open and start the script in R:

  * //File// -> //Open script//
  * //Edit// -> //Run all//
  * A dialog should now open that allows you to select the file (this may be behind the window currently open). Select the CSV file that you downloaded and confirm with //Open//.
  
The survey data should be be located in a data frame that you specified when downloading the script (default is "data"). You can check the variables using the R command ''str(data)''.
