The excelerate package accelerates the creation of supplementary tables for research papers.
- Data Frame Conversion: Easily insert supplementary results as ordered, numbered sheets in Excel spreadsheets.
- Metadata Integration: Include comprehensive metadata with legends and column descriptions in a README sheet.
- Numbered Supplementary Files: Automatically organises and numbers sheets and supplementary files for easy reference.
- Efficient Workflow: Accelerates the preparation of standardised, publication-ready tables.
This makes excelerate an invaluable tool for researchers looking to efficiently prepare tables that meet journal specifications.
Installation
install.packages("devtools")
devtools::install_github("ameliaes/excelerate")
library(excelerate)
Usage
1. Append Meta Data
Use append_meta()
to add column descriptions to your data frame. This function annotates your data frame with descriptions for each column, which is then inserted as a table in the first sheet (“README” sheet) of your Excel spreadsheet.
# Create metadata for iris dataset
results <- append_meta(
results = iris,
colname_descriptions = c(
"Sepal.Length" = "Length of the sepal in cm",
"Sepal.Width" = "Width of the sepal in cm",
"Petal.Length" = "Length of the petal in cm",
"Petal.Width" = "Width of the petal in cm",
"Species" = "Species of iris"
)
)
2. Generate Excel Files
Use the sheet()
, spreadsheet()
and excelerate()
functions to create and save the tables.
# Create spreadsheet specifying tables for each sheet
supplementary_table <- spreadsheet(
title = "Supplementary Table 1. This is space for a legend title describing
generally the contents of the file.",
filename = "path/to/save/example_table.xlsx",
sheet(results, "Sheet name 1", "Specific legends for each table can go here."),
sheet(sheet_2_dataframe, "Sheet name 2", "Sheet legend 2"),
sheet(sheet_3_dataframe, "Sheet name 3", "Sheet legend 3"),
)
# Export to Excel
excelerate(supplementary_table)
Output
The output is an excel file with multiple sheets.
- The first sheet is called “README” by default. The README sheet cells contain the following in order:
- The
title
specified inspreadsheet()
. - The
sheet_legend
s, specified insheet()
, for each sheet. - The meta data supplied to
append_meta()
, for each sheet.
- The
- The remaining sheets are the data frames supplied to
sheet()
. In the order each sheet object was supplied tospreadsheet()
.
Example output from the package vignette at Get Started
:
Contributing
This package is in the early stages of development. If you encounter any issues or have feature requests, please contact me at amelia.edmondson-stait@ed.ac.uk or open a GitHub issue. I’ve aimed to write comprehensive tests, but this may not be enough. I encourage you to try and break this package and let me know what you find (pull requests are welcome). User insights are crucial for creating robust software :-)