Description Usage Arguments Value Cache Examples
Read in a file (locally) or use global object named df
(on INCA)
and coerce to incadata
-object.
1 | use_incadata(file, cache = TRUE, sep = ";", dec = ",", ...)
|
file |
file name as character (ignored if called from INCA) |
cache |
use cache to speed up the loading (see section: "Cache" below) |
sep, dec |
arguments passed to |
... |
arguments passed to |
object returned by as.incadata
To process all data through as.incadata
can be
time consuming for large data sets. It is therefore advised to use caching
(argument cache = TRUE
) to avoid unnecessary processing of already
formatted data. If cache = TRUE
, the function will read and process
the data only the first time (or if the original data is later changed). A
processed and cached version of the data is saved with suffix ".rds". The
cached version is always compared to the original file by its MD5 sum and
is always updated if needed.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# Create a csv file with example data in a temporary directory
fl <- tempfile("ex_data", fileext = ".csv2")
write.csv2(incadata::ex_data, fl)
# First time the file is read from csv2
use_incadata(fl)
dir(tempdir) # a cache file is saved along the original csv2-file
use_incadata(fl) # Next time file loaded from cache
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.