ACRER (Accessibility for Recreation in R) is an R package implementing an optimization and simulation model for urban recreation accessibility. It models how different household types and group types distribute visits across surrounding destination recreation areas (such as forests, nature reserves, and parks) based on transport modes, travel costs, available time budgets, and spatial distance.
quadprog,
interior-point method) for decision modeling across time segments and
household constraints.RSQLite and sqldf for fast querying of
origin-destination matrices, activity patterns, and duration
budgets.generate_pivot, percent_GT_pivot).You can install the latest version of ACRER directly
from GitHub using remotes or devtools:
# Install remotes if not already installed
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
# Install ACRER from GitHub
remotes::install_github("martakis/ACRER")library(ACRER)
# Run main ACRER model simulation
run_Acrer_model()
# Execute model SQL queries against SQLite dataset
Run_Queries()
# Generate summary pivot tables
generate_pivot()R/: Core R functions (run_acrer_model,
Run_Queries, generate_pivot,
crosstab, etc.).inst/extdata/: Bundled example datasets, SQLite
databases (Basic_Tables.db), and RDS pivot files.vignettes/: Detailed documentation and supplementary
materials (ACRER_vignette.Rmd).tests/testthat/: Unit tests verifying model
calculations and cross-tabulations.For a comprehensive guide on the model mathematical framework, database tables, and workflow, consult the package vignette:
vignette("ACRER_vignette", package = "ACRER")To keep the main branch stable and ensure all code
passes R CMD check before being published, follow this
Feature Branch workflow:
flowchart TD
A["main branch (stable code)"] -->|1. Create feature branch| B["feature/my-new-feature"]
B -->|2. Code & test locally| C["git commit -m '...'"]
C -->|3. Push branch| D["git push -u origin feature/my-new-feature"]
D -->|4. GitHub Actions runs R CMD check| E{"CI Check Passed?"}
E -->|No| B
E -->|Yes| F["5. Merge Pull Request into main"]
F -->|6. Sync main locally & clean up| G["git checkout main && git pull"]
main branchAlways create new branches from an up-to-date main
branch:
git checkout main
git pull origin main
git checkout -b feature/my-new-featureMake your code changes, run tests locally, then stage and commit:
git status
git add .
git commit -m "Add new recreation analysis function and tests"Push your branch to GitHub to trigger automated CI checks:
git push -u origin feature/my-new-featuremain.Once merged, return to main, pull the updated code, and
delete the temporary branch:
git checkout main
git pull origin main
git branch -d feature/my-new-featureThis package is licensed under the GPL-2 license.
Georgios Martakis
Email:
georgios.martakis@gmail.com
GitHub: @martakis