Skip to content

Commit

Permalink
add env var to .Renviron, not .Rprofile, derr
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCowgill committed Jun 14, 2024
1 parent bdbee06 commit b22593d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion R/read_abs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
#> <chr+lbl> <dbl+l> <chr+lbl> <dbl+lbl> <dbl+lbl> <chr+lbl> <int>
#> <chr+lbl> <chr+l> <chr+lbl> <chr+lbl> <chr+lbl> <chr+lbl> <dbl>
#> 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
Expand All @@ -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 <int>, unit_measure <chr+lbl>,
#> # obs_status <chr+lbl>, obs_comment <lgl>
#> # ℹ 4 more variables: obs_value <dbl>, unit_measure <chr+lbl>,
#> # obs_status <chr+lbl>, obs_comment <dbl>
```

Let’s say I’m only interested in the population projections for males,
Expand Down Expand Up @@ -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
#> <chr+lbl> <dbl+l> <chr+lbl> <dbl+lbl> <dbl+lbl> <chr+lbl> <int>
#> <chr+lbl> <chr+l> <chr+lbl> <chr+lbl> <chr+lbl> <chr+lbl> <dbl>
#> 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
Expand All @@ -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 <int>, unit_measure <chr+lbl>,
#> # obs_status <chr+lbl>, obs_comment <lgl>
#> # ℹ 4 more variables: obs_value <dbl>, unit_measure <chr+lbl>,
#> # obs_status <chr+lbl>, obs_comment <dbl>
```

Note that in some cases, querying the API without filtering the data
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion man/read_abs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b22593d

Please sign in to comment.