Skip to contents

Read Data File with Hash Verification

Usage

read_file_with_hash(
  file_path,
  ...,
  algo = "blake3",
  reader = NULL,
  force = FALSE
)

Arguments

file_path

path to data file

...

additional arguments to digest, read_csv, read_parquet, read_sas, read_pzfx, read_xpt, or reader

algo

hashing algorithm to use, default is "blake3"

reader

optional function used to read the file, called as reader(file_path, ...). Required for file extensions this function doesn't know how to read. For a known extension (csv, parquet, sas7bdat, xpt, pzfx, xlsx/xls/xlsm), reader is ignored unless force = TRUE.

force

if TRUE, use reader even for a known extension instead of the built-in reader. Must be FALSE (the default) when reader is not supplied.

Value

data within the supplied file

See also

Examples

if (FALSE) { # \dontrun{
dat <- read_file_with_hash("data/derived/PK_data.parquet")
dat2 <- read_file_with_hash("data/source/data.csv")
dat3 <- read_file_with_hash("data/derived/pk.feather", reader = arrow::read_feather)
} # }