Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created October 7, 2019 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monogenea/983a436170818b6b2db2c3a507d73241 to your computer and use it in GitHub Desktop.
Save monogenea/983a436170818b6b2db2c3a507d73241 to your computer and use it in GitHub Desktop.
# Convert UTC to EDT
allTweets %<>% dplyr::mutate(created_at = as_datetime(created_at, tz = "UTC")) %>%
dplyr::mutate(created_at = with_tz(created_at, tzone = "America/New_York"))
# Produce lat and lng coordinates
allTweets <- lat_lng(allTweets)
# Plot
par(mar = rep(12, 4))
map("state", lwd = .25)
# plot lat and lng points onto state map
with(allTweets, points(lng, lat,
pch = 16, cex = .25,
col = rgb(.8, .2, 0, .2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment