Skip to contents

Takes data as delivered by CCAL, extracts it, and rewrites it to tabs in an xlsx file or csv files in a folder.

Usage

machineReadableCCAL(
  files,
  format = c("xlsx", "csv"),
  destination_folder = "./",
  overwrite = FALSE,
  concat = FALSE
)

Arguments

files

Path to .xlsx file delivered by CCAL. Use a character vector to specify multiple files.

format

File format to export machine readable data to - either "xlsx" or "csv"

destination_folder

Folder to save the data in. Defaults to current working directory. Folder must already exist.

overwrite

Overwrite existing file (Defaults to TRUE as with write.table)

concat

If concat is set to TRUE, the function creates one file, rather than one file for every CCAL deliverable. By default, concat is set to FALSE, so the function creates separate files for every CCAL deliverable. If only one file path is supplied to the files argument, this parameter does not affect the output.

Value

Invisibly returns a list containing the data that were written to file.

Examples

if (FALSE) { # \dontrun{
# Get file paths
all_files <- use_example_data(file_names = use_example_data())

# Write to xlsx
machineReadableCCAL(all_files, destination_folder = "ccal_tidy")  # Write one file of tidied data per input file

# Write to csv
machineReadableCCAL(all_files, format = "csv", destination_folder = "ccal_tidy")  # Write one folder of tidied CSV data per input file

} # }