November 2018
Beginner to intermediate
420 pages
10h 4m
English
For reading and writing files—for example, CSV files—there is no other function as fast and efficient as fread and fwrite in R as of today. Let us first see how to read and write CSV files as shown as follows:
# fwrite: Writing csv files # Check the help file for fwrite as it includes numerous options that can be passed to the fwrite function. ?fwrite
The simplest way to use fwrite is to pass the name of the data.table or data.frame as the first argument followed by the name of the file you'd like to create, as follows:
fwrite(dstate, file="dstate.csv") # Save data.table dstate into the csv file dstate.csv # Note that we can change the separator using the sep argument (eg., sep="|) # To read back ...
Read now
Unlock full access