Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Correct fetching and saving updated JSON and stations lists
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Mar 26, 2021
1 parent 6ab66d1 commit 1e59e03
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
12 changes: 10 additions & 2 deletions data-raw/create_BOM_station_list.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ new_JSONurl_site_list <-

## Show Changes from Last Release

To ensure that the data being compared is from the most recent release, reinstall bomrang from CRAN.
To ensure that the data being compared is from the most recent release, reinstall _bomrang_ from CRAN.

```{r diff-codes}
install.packages("bomrang", repos = "http://cran.us.r-project.org")
Expand All @@ -300,6 +300,8 @@ if (!dir.exists("../inst/extdata")) {
dir.create("../inst/extdata", recursive = TRUE)
}
JSONurl_site_list <- new_JSONurl_site_list
# Save database
save(JSONurl_site_list,
file = "../inst/extdata/JSONurl_site_list.rda",
Expand Down Expand Up @@ -345,8 +347,14 @@ load(system.file("extdata", "stations_site_list.rda", package = "bomrang"))
#### Save stations_site_list Data and Changes

```{r save-stations-site-list}
if (!dir.exists("../inst/extdata")) {
dir.create("../inst/extdata", recursive = TRUE)
}
stations_site_list <- new_stations_site_list
save(stations_site_list,
file = "../inst/extdata/current_stations_site_list.rda",
file = "../inst/extdata/stations_site_list.rda",
compress = "bzip2")
save(stations_site_list_changes,
Expand Down
24 changes: 20 additions & 4 deletions data-raw/create_BOM_station_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,17 @@ install.packages("bomrang", repos = "http://cran.us.r-project.org")
## Installing package into '/Users/adamsparks/Library/R/4.0/library'
## (as 'lib' is unspecified)

## Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib:
## cannot open URL 'http://cran.us.r-project.org/src/contrib/PACKAGES'

## Warning: package 'bomrang' is not available for this version of R
##
## The downloaded binary packages are in
## /var/folders/hc/tft3s5bn48gb81cs99mycyf00000gn/T//Rtmpd2qYxg/downloaded_packages
## A version of this package for your version of R might be available elsewhere,
## see the ideas at
## https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

## Warning: unable to access index for repository http://cran.us.r-project.org/bin/macosx/contrib/4.0:
## cannot open URL 'http://cran.us.r-project.org/bin/macosx/contrib/4.0/PACKAGES'

``` r
load(system.file("extdata", "JSONurl_site_list.rda", package = "bomrang"))
Expand Down Expand Up @@ -374,6 +382,8 @@ if (!dir.exists("../inst/extdata")) {
dir.create("../inst/extdata", recursive = TRUE)
}

JSONurl_site_list <- new_JSONurl_site_list

# Save database
save(JSONurl_site_list,
file = "../inst/extdata/JSONurl_site_list.rda",
Expand Down Expand Up @@ -2241,8 +2251,14 @@ load(system.file("extdata", "stations_site_list.rda", package = "bomrang"))
#### Save stations\_site\_list Data and Changes

``` r
if (!dir.exists("../inst/extdata")) {
dir.create("../inst/extdata", recursive = TRUE)
}

stations_site_list <- new_stations_site_list

save(stations_site_list,
file = "../inst/extdata/current_stations_site_list.rda",
file = "../inst/extdata/stations_site_list.rda",
compress = "bzip2")

save(stations_site_list_changes,
Expand All @@ -2262,7 +2278,7 @@ save(stations_site_list_changes,
## collate en_AU.UTF-8
## ctype en_AU.UTF-8
## tz Australia/Perth
## date 2021-03-24
## date 2021-03-26
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## package * version date lib source
Expand Down
Binary file modified inst/extdata/JSONurl_site_list.rda
Binary file not shown.
Binary file modified inst/extdata/stations_site_list.rda
Binary file not shown.

0 comments on commit 1e59e03

Please sign in to comment.