read file with caching

yread_tsv(
  file,
  reader = utils::read.delim,
  params = list(),
  cache_dir = tempdir()
)

yread(file, reader = readLines, params = list(), cache_dir = NULL)

Arguments

file

a file or url

reader

a function to read the 'file_url'

params

a list of parameters that passed to the 'reader'

cache_dir

a folder to store cache files. If set to NULL will disable cache.

Value

the output of using the 'reader' to read the 'file_url' with parameters specified by the 'params'

Details

This function read a file (local or url) and cache the content.

Author

Yonghe Xia and Guangchuang Yu