Posting here (rather than Github) as it is not an issue with the
I am doing simple choropleth maps of
varinterest for U.S. counties (N~3000) using
tmap (data stored in
data object). Each map also has a key column that we will call
category. I am rendering a variable of about ~300 counties for a
varinterest for a
category, but I would also like to fill the counties with missing data as gray.
My current method is as follows:
tm_shape(data) + tm_fill() + tm_shape(data %>% filter(category='cat1')) + tm_polygons(varinterest) +
However, this is a bit slow (taking 5-7 minutes to render on a very strong computer). Mapping only the variable of interest (i.e. the second
tm_shape(... takes only a few seconds.
I feel like I am missing something obvious that might speed up rendering - any advice?
I will work on a reproducible example and post my times.