read_dat | R Documentation |
Unzip and read into memory. The read_dat_dt
function will return a data.table
object, replacing the previous as.data.table
argument which is now deprecated. You can
use the same arguments as the read_dat
function. If cache = TRUE, the first time you call
this function, the data is cached in a folder called .dipr
in a format specified by
the cache_type argument. This function expects a data dictionary with the following columns:
start
stop
name
read_dat( data_path, data_dict, as.data.table = FALSE, use_cache = FALSE, col_select = NULL, col_types = NULL, data_format = c("fwf", "csv", "tsv", "csv2"), tz = "UTC", date_format = "%AD", time_format = "%AT", ... ) read_dat_dt(...)
data_path |
A path or a vector of paths to a |
data_dict |
A data.frame with |
as.data.table |
Deprecated. See |
use_cache |
deprecated, |
col_select |
A vector of column names |
col_types |
One of If Column specifications created by Alternatively, you can use a compact string representation where each character represents one column:
|
data_format |
the format of the input data. Default is |
tz |
what timezone should datetime fields use? Default UTC. This is recommended to avoid timezone pain, but remember that the data is in UTC when doing analysis. See OlsonNames() for list of available timezones. |
date_format |
date format for columns where date format is not specified in |
time_format |
time format for columns where time format is not specified in |
... |
Arguments passed on to
|
read_dat_dt
:
data_dict_path <- dipr_example("starwars-dict.txt") dict <- read.table(data_dict_path) dat_path <- dipr_example("starwars-fwf.dat.gz") read_dat(data_path = dat_path, data_dict = dict, col_types = "cddlcD", date_format = "%Y%m%d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.