This is an R package with analysis utilities and approaches for a data set of obscured and anonymized Clipper smart card transactions.
This package can be used to support documentation and collaboration around the analysis of anonymized Clipper trip data with extensible, open-source, industry-standard data analysis tools like RStudio.
It can be used to help answer questions like the following:
For example:
The DV Data Lake schemas clipper
and clipper_sandbox1
are the major dependency of this package. Some limited documentation for those schemas can be found here.
if (!require(devtools)) {
install.packages('devtools')
}
devtools::install_github('bayareametro/clpr')
This package has a number of dependencies, the major ones being the tidyverse
and RPostgres
We’ve tested it on an MTC Windows 10 machine and Mac OS Sierra and it seems to work on both, though we need to do more testing.
If you define environmental variables for the database, you can use the connect_rs()
function to connect to the database. See expected variable names in R/connect_db.R
Otherwise, you’ll have to connect to the db as you prefer.
If you set environmental variables as above, you can run some of the (admittedly not complete) tests with Ctrl/Cmd + Shift + T or devtools::test().
This package was started as a set of R Markdown scripts in 2014. Those scripts were based around a database that is not available to us presently. So for now the scripts were removed from the repository but are part of git history. They may be useful for understanding how to work with these data in the future and can be found here and here.
Docs can be re-built with pkgdown like so:
library(pkgdown)
pkgdown::build_site()
The output to the ‘docs’ folder.