Learn R Programming

dataversionr (version 0.9.0)

read_dv: Read dv

Description

Read a version of a versioned dataset into a data frame

Usage

read_dv(destination, as_of = NA, source = "latest")

Value

a data frame

Arguments

destination

a local directory path or an arrow SubTreeFileSystem

as_of

the valid date at which you'd like to read the dv

source

the source of the dv. Options are 'latest', 'diffs' or 'backup'

Examples

Run this code
temp_dir <- tempfile()
dir.create(temp_dir, recursive = TRUE)
df <- data.frame(a = 1:5, b = letters[1:5])
create_dv(df, temp_dir, backup_count = 5L)

read_dv(temp_dir)

read_dv(temp_dir, source = "backup")

read_dv(temp_dir, as_of = lubridate::now(), source = "diffs")

unlink(temp_dir)

Run the code above in your browser using DataLab