README.md

datafile

Build Status

The datafile package is build around the philosophy that data should be seperated from code. This means that data is always written to a different location (directory) than your current working directory.

Installation

You can install the github version of this package with

devtools::install_github("jspijker/datafile")

Basic Example

In this example we create a datadirectory using datafileInit() under the current working directory. Then we created some variable x. And using saveRDS and datafile we save it to disk. The final RDS file is now saved to /tmp/Rtmp.....//data/x.rds.


datafileInit(basedir=tempdir()) 
x<-rnorm(10)
saveRDS(x,datafile("x.rds"))

To retrieve the rds file, we use:

x<-readRDS(datafile("x.rds"))

If even datafile is to much typing for you, you can use the alias dfn()

x<-readRDS(dfn("x.rds"))

Please see the vignette for more examples how to use this function.



jspijker/datafile documentation built on Nov. 8, 2024, 6:47 p.m.