xlsx_cutter {xlcutter}R Documentation

Create a data.frame from a folder of non-rectangular excel files

Description

Create a data.frame from a folder of non-rectangular excel files based on a defined custom template

Usage

xlsx_cutter(
  data_files,
  template_file,
  data_sheet = 1,
  template_sheet = 1,
  marker_open = "{{",
  marker_close = "}}"
)

Arguments

data_files

vector of paths to the xlsx files to parse

template_file

path to the template file to use as a model to parse the xlsx files in data_folder

data_sheet

sheet id to extract from the xlsx files

template_sheet

sheet id of the template file to use as a model to parse the xlsx files in data_folder

marker_open, marker_close

character marker to mark the variables to extract in the template_file

Value

A rectangular data.frame with columns as defined in the template. Column types are determined automatically by type.convert()

Examples


data_files <- list.files(
  system.file("example", "timesheet", package = "xlcutter"),
  pattern = "\\.xlsx$",
  full.names = TRUE
)

template_file <- system.file(
  "example", "timesheet_template.xlsx",
  package = "xlcutter"
)

xlsx_cutter(
  data_files,
  template_file
)


[Package xlcutter version 0.1.1 Index]