From b22593d6868ae5cb47591f70e9d81ff723098cd3 Mon Sep 17 00:00:00 2001 From: Matt Cowgill Date: Fri, 14 Jun 2024 01:08:39 +0000 Subject: [PATCH] add env var to .Renviron, not .Rprofile, derr --- R/read_abs.R | 3 ++- README.Rmd | 2 +- README.md | 20 ++++++++++---------- man/read_abs.Rd | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/R/read_abs.R b/R/read_abs.R index a38ee94..0d12cf5 100644 --- a/R/read_abs.R +++ b/R/read_abs.R @@ -75,7 +75,8 @@ #' #' For example, the following code sets the environment variable for your #' current session: s`Sys.setenv("R_READABS_DL_METHOD" = "wininet")` -#' You can add `"R_READABS_DL_METHOD"` to your .Rprofile to have this persist across sessions. +#' You can add `R_READABS_DL_METHOD = "wininet"` to your .Renviron to have +#' this persist across sessions. #' #' The `release_date` argument allows you to download table(s) other than the #' latest release. This is useful for examining revisions to time series, or diff --git a/README.Rmd b/README.Rmd index f3bbd74..2fddc2a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -228,7 +228,7 @@ For example, the following code sets the environment variable for your current s Sys.setenv("R_READABS_DL_METHOD" = "wininet") ``` -You can add `"R_READABS_DL_METHOD"` to your .Rprofile to have this persist across sessions. +You can add `R_READABS_DL_METHOD = "wininet"` to your .Renviron to have this persist across sessions. If you have other issues using `{readabs}` in your corporate environment, I would appreciate you opening an issue on GitHub. diff --git a/README.md b/README.md index 132ed2d..f2e67de 100644 --- a/README.md +++ b/README.md @@ -215,10 +215,10 @@ We can download the file as follows: ``` r payrolls_t4_path <- download_abs_data_cube("weekly-payroll-jobs", "004") -#> File downloaded in /tmp/Rtmpgdh0CC/6160055001_DO004.xlsx +#> File downloaded in /tmp/RtmpV2bAuK/6160055001_DO004.xlsx payrolls_t4_path -#> [1] "/tmp/Rtmpgdh0CC/6160055001_DO004.xlsx" +#> [1] "/tmp/RtmpV2bAuK/6160055001_DO004.xlsx" ``` The `download_abs_data_cube()` function downloads the file and returns @@ -284,7 +284,7 @@ In this case, I could download the entire dataflow with: read_api("ABORIGINAL_POP_PROJ") #> # A tibble: 72,144 × 11 #> measure sex_abs age asgs_2011 proj_series frequency time_period -#> +#> #> 1 POP_PROJ [Proj… 3 [Per… A04 [0 -… 1 [New S… 3 [Series … A [Annua… 2016 #> 2 POP_PROJ [Proj… 3 [Per… A04 [0 -… 1 [New S… 3 [Series … A [Annua… 2017 #> 3 POP_PROJ [Proj… 3 [Per… A04 [0 -… 1 [New S… 3 [Series … A [Annua… 2018 @@ -296,8 +296,8 @@ read_api("ABORIGINAL_POP_PROJ") #> 9 POP_PROJ [Proj… 3 [Per… A04 [0 -… 1 [New S… 3 [Series … A [Annua… 2024 #> 10 POP_PROJ [Proj… 3 [Per… A04 [0 -… 1 [New S… 3 [Series … A [Annua… 2025 #> # ℹ 72,134 more rows -#> # ℹ 4 more variables: obs_value , unit_measure , -#> # obs_status , obs_comment +#> # ℹ 4 more variables: obs_value , unit_measure , +#> # obs_status , obs_comment ``` Let’s say I’m only interested in the population projections for males, @@ -332,7 +332,7 @@ this by supplying a datakey: read_api("ABORIGINAL_POP_PROJ", datakey = list(sex_abs = 1)) #> # A tibble: 24,048 × 11 #> measure sex_abs age asgs_2011 proj_series frequency time_period -#> +#> #> 1 POP_PROJ [Proj… 1 [Mal… A04 [0 -… 1 [New S… 7 [Series … A [Annua… 2016 #> 2 POP_PROJ [Proj… 1 [Mal… A04 [0 -… 1 [New S… 7 [Series … A [Annua… 2017 #> 3 POP_PROJ [Proj… 1 [Mal… A04 [0 -… 1 [New S… 7 [Series … A [Annua… 2018 @@ -344,8 +344,8 @@ read_api("ABORIGINAL_POP_PROJ", datakey = list(sex_abs = 1)) #> 9 POP_PROJ [Proj… 1 [Mal… A04 [0 -… 1 [New S… 7 [Series … A [Annua… 2024 #> 10 POP_PROJ [Proj… 1 [Mal… A04 [0 -… 1 [New S… 7 [Series … A [Annua… 2025 #> # ℹ 24,038 more rows -#> # ℹ 4 more variables: obs_value , unit_measure , -#> # obs_status , obs_comment +#> # ℹ 4 more variables: obs_value , unit_measure , +#> # obs_status , obs_comment ``` Note that in some cases, querying the API without filtering the data @@ -367,8 +367,8 @@ current session: Sys.setenv("R_READABS_DL_METHOD" = "wininet") ``` -You can add `"R_READABS_DL_METHOD"` to your .Rprofile to have this -persist across sessions. +You can add `R_READABS_DL_METHOD = "wininet"` to your .Renviron to have +this persist across sessions. If you have other issues using `{readabs}` in your corporate environment, I would appreciate you opening an issue on GitHub. diff --git a/man/read_abs.Rd b/man/read_abs.Rd index 6433464..73ae6af 100644 --- a/man/read_abs.Rd +++ b/man/read_abs.Rd @@ -94,7 +94,8 @@ download files by setting the \code{"R_READABS_DL_METHOD"} environment variable. For example, the following code sets the environment variable for your current session: s\code{Sys.setenv("R_READABS_DL_METHOD" = "wininet")} -You can add \code{"R_READABS_DL_METHOD"} to your .Rprofile to have this persist across sessions. +You can add \code{R_READABS_DL_METHOD = "wininet"} to your .Renviron to have +this persist across sessions. The \code{release_date} argument allows you to download table(s) other than the latest release. This is useful for examining revisions to time series, or