guess_read_function: Guess read function from file extension

View source: R/pb_read.R

guess_read_functionR Documentation

Guess read function from file extension

Description

This function accepts a filename and tries to return a valid function for reading it.

Usage

guess_read_function(file)

Arguments

file

filename to parse

Details

guess_read_function understands the following file extensions:

  • rds with readRDS

  • csv, csv.gz, csv.xz with utils::read.csv

  • tsv, tsv.gz, tsv.xz with utils::read.delim

  • parquet with arrow::read_parquet

  • txt, txt.gz, txt.xz with readLines

  • json, json.gz, json.xz with jsonlite::fromJSON

Value

function for reading the file, if found

See Also

Other pb_rw: guess_write_function(), pb_read(), pb_write()


cboettig/piggyback documentation built on Feb. 29, 2024, 2:35 a.m.