read_csv: Read a csv file
Description
Read a csv file
Usage
read_csv(name = NULL, head = FALSE, dirname = NULL, ...)
Value
the output will be a data.table object, that is,
an output from the data.table function, fread
Arguments
- name
a character string of the csv file name without the
".csv" extension. For example, if the csv file to read is "myfile.csv",
enter name = "myfile"
- head
logical. if head = TRUE
, prints the first five
rows of the data set.
- dirname
a character string of the directory containing
the csv file, e.g., dirname = "c:/Users/Documents"
- ...
optional arguments for the fread
function
from the data.table package. Any arguments for data.table's fread
function can be used, e.g., fill = TRUE
, nrows = 100
Examples
Run this codeif (FALSE) {
mydata <- read_csv("myfile")
}
Run the code above in your browser using DataLab