Skip to content

Commit

Permalink
bulk data snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed May 29, 2019
1 parent 0c764bc commit b60af24
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
^seaice\.Rproj$
^README\.Rmd$
^inst/examples/*.gif$
^data-raw$
^*.tar.gz$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.Rhistory
.RData
inst/doc
data-raw/ice.rds
ice_data-raw.tar.gz
19 changes: 19 additions & 0 deletions data-raw/BULK.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
library(furrr)
plan(multicore)
s <- icefiles()
n <- icefiles(hemisphere = "north")
south <- future_map(s$fullname, readBin, what = "raw", n = 332 * 316)
north <- future_map(n$fullname, readBin, what = "raw", n = 448 * 304)
ice <- tibble::tibble(date = s$date, south = south, north = north)
saveRDS(ice, "data-raw/ice.rds")

## TODO: implement read since a year ago (make sure we get updates)
## smarter, keep the file name too and invalidate on that

archivefile <- "ice_data-raw.tar.gz"
unlink(archivefile)
system(glue::glue("tar cvzf {archivefile} data-raw"))
library(piggyback)
pb_upload(archivefile, tag = "v0.1.0")


0 comments on commit b60af24

Please sign in to comment.