read_then_csv: CSV caching and iterating over sheets

View source: R/read_then_csv.R

read_then_csvR Documentation

CSV caching and iterating over sheets

Description

Read in all the sheets from an excel file at once and simultaneously cache to CSV

Usage

read_then_csv(sheet, path)

read_then_csv2(path)

Arguments

sheet

String; Name of an excel sheet

path

String; filepath to the the excel file

Value

NULL. CSV files are written to current working directory.

References

https://readxl.tidyverse.org/articles/articles/readxl-workflows.html#csv-caching-and-iterating-over-sheets

Examples

## Not run: 
library(dplyr)
library(readxl)
library(rlang)
library(purrr)

path <- readxl::readxl_example("datasets.xlsx")
path %>%
  readxl::excel_sheets() %>%
  rlang::set_names() %>%
  purrr::map(read_then_csv, path = path)

read_then_csv2(path)

## End(Not run)

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.