library(ggplot2)
library(dplyr)
library(tidyVA)

tidyVA includes simple features tibbles of VHA geographies.

For this example we’ll use the submarket dataset. This is a tidy dataframe that includes simple features geometry for VHA submarket regions. Although accurate, this output is not very easy to work with.

Since this is now in tidy format, we can easily filter and manipulate the data. The function shift_geo() in tidyVA will project and repositon Alaska and Hawaii. Additionally, an sf object can be mapped multiple times as individual layers representing different attributes:

Alternatively, you can aggregate this dataset to the VISN level, and use as needed. Keep in mind that VHA submarkets in the Caribbean and the Pacific Ocean, are not included - thus, VISNs 21 and 8 are not fully represented.

Spatial intersection

A major limitation of the original data is that attributes are present based on a geography’s hierachy. The county dataset has VHA attributes in addition to State and County attributes. The visn dataset only has a VISN attribute:

With simple features we can easily perform geometric operations and gather attributes based on a spatial relationship:

We can now filter this dataframe by VISN and keep State attributes

Or by State, and keeping VISN attributes. New York for example is mostly within VISN 2, but, there are small catchments areas in the Western and Southern parts of the state that are outside VISN 2.

Plot theme

tidyVA also includes a ggplot theme: theme_va().

This theme has several possible parameters. The core of this function is theme_ipsum from hrbrthemes, but with some changes to the defaults.

Map Theme

When plotting maps, you may want to remove the axis text from geom_sf(). For this, the map argument of theme_va() can be set to TRUE.

Additionally, setting the grid_col argument to “transparent” will remove panel grid lines from the plot.