Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
The base R provides essential functions for importing data:
read.table()—the most general function of the base R for importing data, takes in tabular data with any kind of field separators, including specific ones, such as |.
read.csv()—comma-separated values (CSV) files with . as the decimal separator.
read.csv2()—semicolon-separated values files with , as the decimal separator.
read.delim()—tab-separated values (TSV) files with . as the decimal separator.
read.delim2()—tab-separated values (TSV) files with , as the decimal separator.
In practice, any of these functions can be used to import tabular data with any kind of field and decimal separators: using them for the specified formats of files is only the question of convention and default settings. For example, here is the syntax of the first function: read.table(file, header = FALSE, sep = “”, dec = “.”). The other functions have the same parameters with different default settings that can always be explicitly overwritten.
The tidyverse packages readr and readxl provide some other functions for importing specific file formats. Each of those functions can be further fine-tuned by setting various optional parameters.