I wrote a script to show the number of events in a given county. On my local machine, it displays properly and looks great! But when I run the exact same code on the exact same dataset on a secure server (where I have to be able to run the script in order to incorporate data that has higher security requirements) it looks different, and wrong. The legend doesn't show and the color fill in the counties is missing, too.
library(tidyverse)
library(foreign)
library(haven)
library(data.table)
library(devtools)
library(usmap)
joined_v_cross <- read_dta("path/to/my/data/here.dta")
toy_example <-
plot_usmap(data = joined_v_cross, values = "toy_values", include = c("AL", "AR", "FL", "GA", "LA", "NC", "SC", "KY", "TN", "MS"), color = "blue") +
scale_fill_continuous(low = "white", high = "blue", name = " events count", label = scales::comma) +
labs(title = "Example Map", subtitle = "1810 - 1900") +
theme(legend.position = "right")
toy_example
Map from my local machine:
Map from secure server:
I updated the versions of R, Rstudio, and all of the packages and the maps still look incorrect on the secure server. Any ideas what's going on here? Thank you thank you!