An R package to make it easy to view, copy, interact and publish the data products resulting from the Access to Care analysis. It also contains handy utility functions, and the data needed to create a consistent set of examples across the multiple data product types.
This project combines US Census population data with hospital data provided by Medicare. The Census data is as of 2024, and the hospital Medicare data is as of 2025. The analysis uses individual counties as the unit of measurement. A county is considered underserved based on a linear model that compares the number of hospitals to the population.
The fastest way to get started is to deploy the pre-built content collection directly to your Posit Connect instance.
- Clone the sol-eng/access-to-care repository:
git clone https://github.com/sol-eng/access-to-care.git
cd access-to-care- Install the
accesstocarepackage:
pak::pak("sol-eng/accesstocare")- Deploy all content to Posit Connect:
library(accesstocare)
deploy_content()This will automatically deploy all example data products to your Posit Connect instance. The function will:
- Deploy most content using Git-backed deployment for version control and easy updates
- Set custom thumbnails for each content item
- Configure vanity URLs for easy access
Note: The pins content (pins-data and pins-model) will be deployed directly from your local machine rather than using Git-backed deployment, as they leverage Posit Connect’s pins board infrastructure. Additionally, a Vetiver API endpoint will be created for the model pin, enabling model serving and predictions through a REST API.
If you prefer not to deploy programmatically, you can deploy the content manually through the Posit Connect interface:
- Clone the sol-eng/access-to-care repository
- Follow the instructions for linking Git to Posit Connect to deploy the content
If you want to customize the example content:
- Fork the sol-eng/access-to-care repository
- Clone your fork locally
- Install the package:
pak::pak("sol-eng/accesstocare")
library(accesstocare)- Generate fresh content:
create_content()-
Make your edits to the content folders
-
Ensure the manifests for Connect are still current
create_manifests()- Deploy to Posit Connect:
deploy_content()This will update any needed manifests and deploy your customized content
The package includes 15 example data products demonstrating different ways to visualize and present the Access to Care analysis across multiple frameworks and languages:
"api-python"- REST API using FastAPI and Python"api-r"- REST API using Plumber and R"app-python"- Python Dash application"app-r"- Shiny application"connectwidgets"- Overview application listing all related content"dashboard-r"- Quarto dashboard with R"htmlwidgets-r"- Interactive county-level plot"pdf-r"- PDF report"pins-data"- Data file for pins deployment"pins-model"- Model file for pins deployment (linear regression for hospital/population analysis)"plot-r"- Static ggplot2 map of entire country"presentation-python"- Quarto presentation (Python)"presentation-r"- Quarto presentation (R)"report-python"- Quarto HTML document with Python, Polars, Plotnine, and Great Tables"report-r"- R Markdown HTML report with email template
If you wish to create individual content locally, you can use these
values with create_content():
# Create a specific content type
create_content(content = "app-r")
# Or create all content
create_content(content = "all")