cloud_guess_read_fun: Guess reading function based on file extensions

View source: R/read_write.R

cloud_guess_read_funR Documentation

Guess reading function based on file extensions

Description

Take a look at the switch call. That's basically it. Returns an appropriate function or throws an error if wasn't able to find one.

Usage

cloud_guess_read_fun(file)

Arguments

file

Path to a file relative to project folder root. Can contain only letters, digits, '-', '_', '.', spaces and '/' symbols.

Value

A reading function.

Default reading functions

Here's how we identify a reading function based on file extension

  • .csv: readr::read_csv

  • .json: jsonlite::read_json

  • .rds: base::readRDS

  • .sav: haven::read_sav

  • .xls: cloud_read_excel

  • .xlsx: cloud_read_excel

  • .xml: xml2::read_xml


cloudfs documentation built on May 29, 2024, 11:08 a.m.