The formats and structures in which data comes can be varied. However, thanks to its contributive feature and extensibility, there is a package to load data into R for almost every data structure (at least the standard ones). In order to do this, it is always necessary to use functions that have different argument types according to their nature.
All the delimited formats in R use the same base function, that is, read.table()
. This function uses many arguments but most of them have a default value. The following is a list of the most important ones:
header
: If it is set toT
, the first row is used to assign the names of the data frame.nrows
: This gives the amount of rows to be read. If it is set to-1
, all rows are read.skip
: This states how many rows to skip before reading is started.encoding
: In case the data source contains non-ASCII characters (for example, words in languages different from English), encoding can be passed.