storr (version 1.0.0)

fetch_hook_read: Hook to fetch a resource from a file.

Description

Hook to fetch a resource from a file, for use with driver_external

Usage

fetch_hook_read(fpath, fread)

Arguments

fpath
Function to convert key, namespace into a file path
fread
Function for converting filename into an R pobject

Examples

Run this code
hook <- fetch_hook_read(
    function(key, namespace) paste0(key, ".csv"),
    function(filename) read.csv(filename, stringsAsFactors=FALSE))

Run the code above in your browser using DataCamp Workspace