From 0070d7b16f828cd6e65ec44fbac0a8e2c96802c9 Mon Sep 17 00:00:00 2001 From: Rob Marty Date: Wed, 4 Sep 2024 11:44:57 -0400 Subject: [PATCH] testing --- make_readme_figures/testing.R | 4 ++-- make_readme_figures/testing_from_source.R | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/make_readme_figures/testing.R b/make_readme_figures/testing.R index b4c039e..5178a7f 100644 --- a/make_readme_figures/testing.R +++ b/make_readme_figures/testing.R @@ -29,8 +29,8 @@ if(F){ api_keys_df <- read.csv("~/Dropbox/World Bank/Webscraping/Files for Server/api_keys.csv") google_key_df <- api_keys_df |> - dplyr::filter(Service == "Google Directions API", - Account == "ramarty@email.wm.edu") + dplyr::filter(Service == "Google Javascript API", + Account == "robmarty3@gmail.com") google_key <- google_key_df$Key # Test ------------------------------------------------------------------------- diff --git a/make_readme_figures/testing_from_source.R b/make_readme_figures/testing_from_source.R index 2c82db6..b8000bb 100644 --- a/make_readme_figures/testing_from_source.R +++ b/make_readme_figures/testing_from_source.R @@ -1,4 +1,5 @@ +### Packages library(dplyr) library(googleway) library(htmlwidgets) @@ -19,6 +20,27 @@ files <- file.path("~", "Documents", "Github", "googletraffic", "R") |> pattern = "*.R") for(file_i in files) source(file_i) +api_keys_df <- read.csv("~/Dropbox/World Bank/Webscraping/Files for Server/api_keys.csv") + +google_key_df <- api_keys_df |> + dplyr::filter(Service == "Google Javascript API", + Account == "robmarty3@gmail.com") +google_key <- google_key_df$Key + +# Test ------------------------------------------------------------------------- +gt_make_png(location = c(40.717437418183884, -73.99145764250052), + height = 500, + width = 500, + zoom = 16, + out_filename = paste0("~/Desktop/test123.png"), + google_key = google_key) + +r <- gt_make_raster(location = c(40.717437418183884, -73.99145764250052), + height = 500, + width = 500, + zoom = 16, + google_key = google_key) + nbo <- gadm(country = "KEN", level = 1, path = tempdir()) nbo <- nbo[nbo$NAME_1 == "Nairobi",] %>% st_as_sf()