Tidy Manipulation of CSB Data for St. Louis

The Citizens' Service Bureau of the City of St. Louis is a clearing house for non-emergency service requests. This package provides functions for downloading, categorizing problem requests, cleaning and subsetting CSB data, and projecting the data using the x and y coordinates included with CSB data releases.

lifecycle Travis-CI BuildStatus AppVeyor BuildStatus Coveragestatus DOI CRAN_Status_Badge

The goal of stlcsb is to provide access to data from the City of St. Louis Citizens’ Service Bureau (CSB), the 3-1-1 service for the City of Saint Louis. Residents can contact the number with non-emergency service requests, and the CSB will dispatch these requests to the appropriate City agency. stlcsb also includes functions for cleaning and manipulating these data.


Installing Dependencies

You should check the sf package website and the stlcsb package website for the latest details on installing dependencies for that package. Instructions vary significantly by operating system. For best results, have sf installed before you install stlcsb. Other dependencies, like dplyr, will be installed automatically with stlcsb if they are not already present.

Installing stlcsb

The easiest way to get stlcsb is to install it from CRAN:


The development version of stlcsb can be accessed from GitHub with remotes:

# install.packages("remotes")

Example Usage

stlcsb is used for simplified acquisition and processing of St. Louis CSB Data. In the following example, data is downloaded from the City of St. Louis, filtered to identify only calls related to waste disposal, and then projected to an sf object for mapping.

> library(dplyr)
> csb <- csb_get_data(year = 2017)
trying URL 'https://www.stlouis-mo.gov/data/upload/data-files/csb.zip'
downloaded 58.2 MB
> csb_filter(csb, var = problemcode, category = cat_waste) %>%
+   csb_missingXY(varX = srx, varY = sry, newVar = "missing") %>%
+   filter(missing == FALSE) %>%
+   csb_projectXY(varX = srx, varY = sry) -> waste_2017

Notice that variable names can be either quoted or unquoted, since stlcsb makes full use of non-standard evaluation.

Once the data are projected, they can be explored with packages like mapview:

> library(mapview)
> mapview(waste_2017)

These data can also be mapped using ggplot2 once they have been projected:

> library(ggplot2)
> ggplot() + 
+   geom_sf(data = waste_2017, color = "red", fill = NA, size = .5)

Contributor Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


stlcsb 0.1.2

  • initial CRAN submission
  • add Zenodo release badge to README
  • update installation instructions on README and on the pkgdown site
  • add cran-comments.md

stlcsb 0.1.1

duplicate release

stlcsb 0.1.0

  • Added a NEWS.md file to track changes to the package.
  • Initial package development including package infrastructure, functions, and sample data

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.2 by Christopher Prener, a month ago


Report a bug at https://github.com/slu-openGIS/stlcsb/issues

Browse source code at https://github.com/cran/stlcsb

Authors: Christopher Prener [aut, cre] , Branson Fox [aut]

Documentation:   PDF Manual  

GPL-3 license

Imports dplyr, lubridate, purrr, readr, readxl, rlang, rvest, sf, stringr, tibble, tools, xml2

Suggests ggplot2, knitr, mapview, rmarkdown, testthat, covr

See at CRAN