Package 'erstools'

Title: ERS RMarkdown Template and Functions to Read, Write, Validate, and Visualize Data
Description: What the package does (one paragraph).
Authors: Zach Friedman [aut, cre], Tommy Bellaire [aut] (ORCID: <https://orcid.org/0009-0006-1075-3155>)
Maintainer: Zach Friedman <[email protected]>
License: MIT + file LICENSE
Version: 1.1.2
Built: 2026-06-04 06:49:19 UTC
Source: https://github.com/ERStrategies/erstools

Help Index


Use the skim function to validate your data and output a summary of your columns

Description

This function applies skimr::skim() to summarize a dataset and then formats numeric columns. Numeric values are rounded to one decimal place. If a number is 1,000 or greater, it is formatted with commas.

Usage

ers_column_info(dataset)

Arguments

dataset

A data frame or tibble to be summarized.

Value

A tibble with summary statistics, where numeric values are rounded to one decimal place and large numbers (≥ 1,000) are formatted with commas.


Load Required Libraries and Categorize Output

Description

This function loads a set of commonly used libraries, categorizes them, suppresses unnecessary startup messages, and prints a summary of successfully loaded libraries. If any packages are missing, a warning is displayed at the bottom.

Usage

ers_load_packages()

Value

A categorized summary of loaded libraries and a warning message for missing packages.

Examples

ers_load_packages()

Read files from sharepoint with clean names

Description

Read files from sharepoint with clean names

Usage

ers_read_clean(
  folder_path,
  file_name_with_extension,
  sheet_name = NULL,
  drive_name = "client_work_drive",
  skip_rows = 0,
  na_values = c(""),
  clean_names = TRUE
)

Arguments

folder_path

REQUIRED: The path to the file: https://app.tettra.co/teams/ersknowledge/pages/copying-a-folder-path-from-sharepoint-to-use-in-r

file_name_with_extension

REQUIRED: Supported extensions: .csv, .xls, .xlsx. Example: "student_performance.csv"

sheet_name

OPTIONAL: Only required if you have an excel spreadsheet with multiple sheets. Example: "Sheet 2"

drive_name

OPTIONAL: R will detect what drive the file is from (e.g. 'client_work_drive', 'internal_drive', 'external_drive', or 'data_hub_drive')

skip_rows

OPTIONAL: Only required if your data doesn't start in the first row of the spreadsheet. Example: If your data starts in row 4 then enter 3

na_values

OPTIONAL: By default will change all cells to NA if they have "", "N/A", "NA", or "Missing"

clean_names

OPTIONAL: standardizes column names by removing special characters, converting to snake_case, and ensuring uniqueness

Value

Your loaded data as a data frame with the name raw_data


Read files from sharepoint

Description

Read files from sharepoint

Usage

ers_read_sharepoint(
  folder_path,
  file_name_with_extension,
  sheet_name = NULL,
  drive_name = "client_work_drive",
  skip_rows = 0,
  na_values = c(""),
  clean_names = "FALSE"
)

Arguments

folder_path

REQUIRED: The path to the file: https://app.tettra.co/teams/ersknowledge/pages/copying-a-folder-path-from-sharepoint-to-use-in-r

file_name_with_extension

REQUIRED: Supported extensions: .csv, .xls, .xlsx, .shp Example: "student_performance.csv"

sheet_name

OPTIONAL: Only required if you have an excel spreadsheet with multiple sheets. Example: "Sheet 2"

drive_name

OPTIONAL: R will detect what drive the file is from (e.g. 'client_work_drive', 'internal_drive', 'external_drive', or 'data_hub_drive')

skip_rows

OPTIONAL: Only required if your data doesn't start in the first row of the spreadsheet. Example: If your data starts in row 4 then enter 3

na_values

OPTIONAL: By default will change all cells to NA if they have "", "N/A", "NA", or "Missing"

clean_names

OPTIONAL: standardizes column names by removing special characters, converting to snake_case, and ensuring uniqueness

Value

Your loaded data as a data frame with the name raw_data


Clean beginning path and %20s in sharepoint file names for ers_read_sharepoint and ers_write_sharpoint

Description

Clean beginning path and %20s in sharepoint file names for ers_read_sharepoint and ers_write_sharpoint

Usage

ers_sharepoint_path_clean(full_path)

Arguments

full_path

REQUIRED: The path to the file. This can be pasted directly from SharePoint: https://app.tettra.co/teams/ersknowledge/pages/copying-a-folder-path-from-sharepoint-to-use-in-r

Value

Your cleaned sharepoint path and the sharepoint drive name


Output your data as a nicely formatted table using the gt package

Description

Output your data as a nicely formatted table using the gt package

Usage

ers_table(dataset, title = "Default Title")

Arguments

dataset

REQUIRED: The data that you want to make into a table

title

REQUIRED: Desired title of your data table. Example: "Teacher FTE by School"

Value

Your data as a nicely formatted table


Create a new ERS R Markdown file from a template

Description

Create a new ERS R Markdown file from a template

Usage

ers_template(file_name, include_walkthrough = FALSE)

Arguments

file_name

The name of the new Rmd file to create (e.g., "my_report"). You do not need to include the .Rmd extension.

include_walkthrough

If TRUE or "yes", use the walkthrough template; otherwise, use the standard template

Value

Creates a new Rmd file in your working directory


Update the erstools package from GitHub

Description

Installs or updates the public erstools package from GitHub.

Usage

ers_update_erstools()

Value

Invisibly returns TRUE if installation succeeds.


Write files to sharepoint folders

Description

Write files to sharepoint folders

Usage

ers_write_sharepoint(
  data,
  folder_path,
  file_name_with_extension,
  drive_name = "client_work_drive"
)

Arguments

data

REQUIRED: The data frame, shape file, or ggplot object to be uploaded

folder_path

REQUIRED: The folder where you want the data to be saved: https://app.tettra.co/teams/ersknowledge/pages/copying-a-folder-path-from-sharepoint-to-use-in-r

file_name_with_extension

REQUIRED: Supported extensions: .csv, .xlsx, .png(ggsave). Example: "student_performance.csv"

drive_name

OPTIONAL: R will detect what drive the file is from (e.g. 'client_work_drive', or 'internal_drive')

Value

A message that your file was successfully uploaded.