Create map showing the geographic distribution of patients
plot_person_map.Rd
Create map showing the geographic distribution of patients
Arguments
- ds
A PicnicHealth data set list object.
- per_capita
A boolean indicator, defaults to
FALSE
, which plots raw patient counts. IfTRUE
, plots the number of patients per 10,000,000 people in each state, rather than the absolute number of patients in each state, using the US Census's July 1, 2022 Annual Estimate of the Resident Population for the United States.
Details
Requires the following tables in the PicnicHealth data set
list object, ds
:
visit
care_site
Patient states are inferred using the get_patient_state_province()
function:
patients are assigned to the state in which they had the most visits in the
two years preceding their most recent visit. If multiple states or
provinces have the same number of visits for a patient, the state/province
with the most recent visit is selected.
Uses the plot_usmap()
function from the usmap package.
See also
plot_visit_timeline()
(orplot_clinical_document_timeline()
for legacy PicnicHealth datasets) to create a clinical document timeline plot for a patient.table_one()
to create a table to describe some basic demographic distributions for patients in the data set.
Examples
if (FALSE) { # \dontrun{
ds <- load_data_set("/path/to/data")
plot_person_map(ds)
plot_person_map(ds, per_capita = TRUE)
} # }