Read data

Teppo Valtonen · 2023

Before you can process data in R, you have to read it from an external source. R has functions for reading data from, for example, CSV and Excel files. By default, the reading functions try to guess the data types of variables from the data. However, especially for survey data this approach has limitations. Survey data is often very sparse (there are many missing values) and categories may have been encoded with numerals. You can also define the data types explicitly at reading. The most flexible option, however, is to read the data as text and parse the values according to your variable specification. Furthermore, it is recommended to add metadata while reading the data into R.

Read the paper · More papers on PaperTik