Learn R Programming

upstartr

Upstartr is a companion package to The Globe and Mail's data journalism template, startr. It contains a series of functions meant to be consumed by the template project, plus additional helpful functions for day-to-day data journalism.

Installation

install.packages('upstartr')

Or, if you want to run a development version, you can install it from GitHub by doing:

devtools::install_github('globeandmail/upstartr')
library(upstartr)

Reference

You can find the full reference manual for upstartr's functions here.

Credits

Spark plug illustration by Murat Yükselir.

Get in touch

If you've got any questions, feel free to send us an email, or give us a shout on Twitter:

Tom Cardoso @tom_cardoso

Copy Link

Version

Install

install.packages('upstartr')

Monthly Downloads

243

Version

0.1.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Tom Cardoso

Last Published

January 9th, 2024

Functions in upstartr (0.1.2)

run_process

Runs the processing step on a startr project.
scale_y_percent

Create a continuous y-axis scale using percentages
read_all_excel_sheets

Combine all sheets in an Excel file
write_plot

Write out a ggplot2 graphic with minimal configuration
not.null

Opposite of is.null
write_excel

Write out an Excel file with minimal configuration
run_notebook

Runs the notebook rendering step for a startr project.
run_config

Configures an existing startr project
not.na

Opposite of is.na
reorder_within

Reorder an x or y axis within facets
run_analyze

Runs the analysis step for a startr project.
scale_x_percent

Create a continuous x-axis scale using percentages
remove_non_utf8

Removes non-UTF-8 characters
render_notebook

Renders out an RMarkdown notebook.
scale_x_reordered

Passed after reorder_within to reorder x-axis along facets
write_shp

Write a shapefile to disk
scale_y_reordered

Passed after reorder_within to reorder x-axis along facets
run_visualize

Runs the visualization step for a startr project.
unaccent

De-accents strings
simplify_string

Simplifies strings for analysis
dir_data_cache

Get path within cached data directory.
convert_str_to_logical

Converts a character vector to logicals
combine_excels

Combine Excel files in a directory
dir_data_processed

Get path within processed data directory.
clean_columns

Cleans up column names by forcing them into tidyverse style
calc_mode

Calculate mode
begin_processing

Runs the pre-processing step on a startr project.
calc_index

Index values
dir_data_out

Get path within disposable data outputs directory.
combine_csvs

Combine CSVs in a directory
dir_scrape

Get path within scrape directory.
dir_plots

Get path within plots directory.
dir_data_raw

Get path within raw data directory.
dir_src

Get path within src directory
dir_path

Construct an arbitrary path.
end_processing

Runs the post-processing step on a startr project.
dir_reports

Get path within reports directory.
initialize_startr

Initialize startr project
%not_in%

Opposite of %in%