Data Science Desktop Survival Guide
by Graham Williams |
|||||
CSV Data |
library(readr) # Modern and efficient data reader/writer.
ds <- read_csv("mydata.csv")
Column types can be specified using
col_types= Writing a dataset to a csv file is straightforward using readr::write_csv():
|
library(rattle) # Dataset: weatherAUS.
library(dplyr) # Wrangling: select(). library(readr) # Modern and efficient data reader/writer. ds <- weatherAUS fname <- "temperatureAUS.csv" ds %>% select(Date, Location, MinTemp, MaxTemp, Temp9am, Temp3pm) %>% write_csv(fname)
To turn off the messaging of the identified columns, set the option for the number of columns to report to 0: |
options(readr.num_columns=0)
To turn it back on, set it to NULL.
|