Calculates Daily Visitor Counts From Raw Daily Gate Counts, Summarize Visitor Counts and Visualize
gateCounts
is an R package for calculating daily visitor counts,
provided raw daily gate counts, gate directionality, and gate counter
maximum value. Calculated visitor counts or user provided visitor counts
can be summarized on daily, weekly, monthly basis and visualized. Users
may choose to visualize data for one institute or multiple institutes.
For details see below and refer to vignette.
To install the latest version of the package:
require("devtools")
devtools::install_github("anjalisilva/gateCounts",
build_vignettes = TRUE)
library("gateCounts")
To run the Shiny app:
gateCounts::runGateCount()
To list all functions available in the package:
ls("package:gateCounts")
gateCounts
package contains 6 functions.
-
gateCountsToVisitorCounts for calculating daily visitor counts, provided a numeric vector or a tibble containing values of raw daily gate counts for one institute, gate directionality and gate counter maximum value.
-
visitorCountSummary for calculating weekly, monthly visitor counts and summary statistics like daily, weekly, monthly mean and median, busiest and least busiest day, week, and month for the entire duration for which visitor count data is provided by user.
-
gateCountsVisDaily permit to create plots (bar, line, and heatmap) showing daily visitor counts for one institute. Both count and log-transformed count plots are provided to help visualize trends.
-
gateCountsVisWeekly for creating plots showing visitor counts by week for one institute. Both count and log-transformed count plots are provided to help visualize trends.
-
gateCountsVisMonthly for creating plots showing visitor counts by month for one institute. Both count and log-transformed count plots are provided to help visualize trends.
-
runGateCount starts the Shiny app for this R package. Under construction.
-
gateCountsVisMultiple for creating plots comparing visitor counts from multiple institutes.
An overview of the package is illustrated below:
gateCounts
is an R package for calculating daily, weekly, monthly, and
cumulative visitor counts, provided raw daily gate counts, gate
directionality, and gate counter maximum value. The package was
developed to improve methodologies for calculating visitor counts from
gate counts, initially using library daily gate count values as an
example. However, the package can be applied to calculate visitor counts
from any setting. The factors adjusted for are outlined below.
-
To calculate visitor counts from raw daily gate counts, today’s gate count reading is subtracted from yesterday’s reading. Negative visitor counts can result if the gate counter has reset. This package attempts to detect and correct for this.
-
Negative visitor counts can also result from a lower gate count value that has been entered compared to previous day. This may result from manual entry or system errors. This package attempts to detect and correct for this.
-
The package attempts to account for when the daily gate count has been forgotten to be reported or days are skipped. This method doesn’t assign counts for missed days, but rather adjust for cumulative visitor count sum.
-
The package checks for any possible non-numeric characters (e.g., “turned off”, “Diagnosis”, “closed”, “Clean filter”), then adjusts for visitor count by taking past, last reported gate count.
Refer to vignette where these issues and solutions are explained with visuals for more information.
If gates are bidirectional, the visitor counts will be divided by two. For cumulative visitor count, our testing has shown that dividing by two after calculating all daily visitor counts helps to provide a better approximation of cumulative gate count, compared to when the daily visitor counts are divided by two and then summed up at the end. Therefore, for cumulative visitor counts from bidirectional gates, all daily visitor counts are summed at then divided by two. Hence, users may find slight differences between summing up daily visitor counts outputted by the package versus cumulative gate count outputted by the package. Refer to vignette where these issues and solutions are explained with visuals for more information.
The Shiny app employing could be run and results could be visualized:
gateCounts::runGateCount()
For tutorials, refer to the vignette:
browseVignettes("gateCounts")
citation("gateCounts")
Silva, A. (2023). gateCounts: An R package for Calculating and Visualizing Visitor Counts Provided Raw Daily Gate Counts. Unpublished.
A BibTeX entry for LaTeX users is
@misc{,
title = {gateCounts: An R package for Calculating and Visualizing Visitor Counts Provided Raw Daily Gate Counts},
author = {A. Silva},
year = {2023},
url = {https://github.com/anjalisilva/gateCounts},
}
- Anjali Silva (anjali@alumni.uoguelph.ca).
gateCounts
welcomes issues, enhancement requests, and other
contributions. To submit an issue, use the GitHub
issues.
- This work was done at University of Toronto Libraries, Ontario, Canada from 2022-2023.