7.10 TSV Data
20200928 A common interchange format for sharing data across different applications is the Tab Separated Value (tsv) file format. Reading tsv files is straight forward using readr::read_tsv().
library(readr) # Modern and efficient data reader/writer. library(stringi) # String concat operator: %s+%. <- "abc" dsname <- dsname %s+% ".tsv" dspath <- read_csv(dspath) abc <- get(dsname)ds
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. <- "weatherAUS" dsname <- get(dsname) ds <- "australian_temperatures.tsv" fname %>% ds select(Date, Location, MinTemp, MaxTemp, Temp9am, Temp3pm) %>% write_tsv(fname)
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0