## Coffee shops (for mobile google earth) ## Note: You need to install the google earth software and the following packages before running this code library(plotKML) library(sp) library(spacetime) coffee_shop <- c("Cafe One", "Caffeine the Elements", "E-Cafe", "Fireball Cafe", "Corner Cafe" , "Williams Fresh Cafe", "The Grind") ## Need a dataframe of labels coffee_df <- data.frame(coffee_shop) lat <- c(-79.91693, -79.92050, -79.92005, -79.92020, -79.91740, -79.91790, -79.91750) long <- c(43.26129, 43.26229, 43.25825, 43.26085, 43.25915, 43.26040, 43.26373) coffee_locations <- data.frame(lat,long) ## Create the coordinates coordinates(coffee_locations) <- c("lat", "long") ## Change projection/mapping class to "CRS" of coordinate reference systems proj4string(coffee_locations) <- CRS("+proj=longlat +datum=NAD27") ## Change object to an SP class coffee_sp <- as(coffee_locations, "SpatialPoints") dates <- rep(as.POSIXct("2018-04-09"),7) coffee_shops_output <- STIDF(sp=coffee_sp, time=dates, data=coffee_df) ## Use red points plotKML(coffee_shops_output,colour_scale=2)