cloud_guess_write_fun: Guess writing function based on file extensions

View source: R/read_write.R

cloud_guess_write_funR Documentation

Guess writing 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_write_fun(file)

Arguments

file

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

Value

A writing function.

Default writing functions

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

  • .csv: readr::write_csv

  • .json: jsonlite::write_json

  • .rds: base::saveRDS

  • .xls: writexl::write_xlsx

  • .xlsx: writexl::write_xlsx

  • .sav: haven::write_sav

  • .xml: xml2::write_xml


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