Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created October 7, 2019 15:58
Embed
What would you like to do?
# 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