From 409892a401e39b8935205578c731d92e1edd6ec3 Mon Sep 17 00:00:00 2001 From: daniel-simeone <109553256+daniel-simeone@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:34:32 -0600 Subject: [PATCH] change error messages and vignette to refer to renamed set_cancensus_api_key change error messages and vignette to refer to renamed set_cancensus_api_key --- R/cancensus.R | 4 ++-- R/intersect_geometry.R | 2 +- vignettes/cancensus.Rmd | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/cancensus.R b/R/cancensus.R index cbae05bb..e20ad08a 100644 --- a/R/cancensus.R +++ b/R/cancensus.R @@ -141,7 +141,7 @@ get_census <- function (dataset, regions, level=NA, vectors=c(), geo_format = NA meta_file <- paste0(data_file, ".meta") if (!use_cache || !file.exists(data_file)) { if (!have_api_key) { - stop(paste("No API key set. Use set_api_key('`) to set one, or set_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) + stop(paste("No API key set. Use set_cancensus_api_key('`) to set one, or set_cancensus_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) } url <- paste0(base_url, "data.csv") response <- if (!quiet) { @@ -206,7 +206,7 @@ get_census <- function (dataset, regions, level=NA, vectors=c(), geo_format = NA meta_file <- paste0(geo_file, ".meta") if (!use_cache || !file.exists(geo_file)) { if (!have_api_key) { - stop(paste("No API key set. Use set_api_key('`) to set one, or set_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) + stop(paste("No API key set. Use set_cancensus_api_key('`) to set one, or set_cancensus_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) } url <- paste0(base_url, "geo.geojson") response <- if (!quiet) { diff --git a/R/intersect_geometry.R b/R/intersect_geometry.R index 3e234223..c26bcba1 100644 --- a/R/intersect_geometry.R +++ b/R/intersect_geometry.R @@ -76,7 +76,7 @@ get_intersecting_geometries <- function(dataset, level, geometry, simplified = F if (!use_cache || !file.exists(data_file)) { if (!have_api_key) { - stop(paste("No API key set. Use set_api_key('`) to set one, or set_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) + stop(paste("No API key set. Use set_cancensus_api_key('`) to set one, or set_cancensus_api_key('`, install = TRUE) to save is permanently in our .Renviron.")) } url <- paste0(cancensus_base_url(),"/api/v1/intersecting_geographies") body <- list(dataset=dataset, diff --git a/vignettes/cancensus.Rmd b/vignettes/cancensus.Rmd index 73119704..775f8860 100644 --- a/vignettes/cancensus.Rmd +++ b/vignettes/cancensus.Rmd @@ -31,7 +31,7 @@ As Statistics Canada does not provide direct API access to Census data, **cancen **cancensus** requires a valid CensusMapper API key to use. You can obtain a free API key by [signing up](https://censusmapper.ca/users/sign_up) for a CensusMapper account. CensusMapper API keys are free and public API quotas are generous; however, due to incremental costs of serving large quantities of data, there limits to API usage in place. For most use cases, these API limits should not be an issue. Production uses with large extracts of fine grained geographies may run into API quota limits. For larger quotas, please get in touch with Jens [directly](mailto:jens@censusmapper.ca). -To check your API key, just go to "Edit Profile" (in the top-right of the CensusMapper menu bar). Once you have your key, you can store it in your system environment so it is automatically used in API calls. To do so just enter `set_api_key(, install = TRUE)` +To check your API key, just go to "Edit Profile" (in the top-right of the CensusMapper menu bar). Once you have your key, you can store it in your system environment so it is automatically used in API calls. To do so just enter `set_cancensus_api_key(, install = TRUE)` ## Installing cancensus