Skip to content

Commit

Permalink
Merge pull request #38 from USEPA/dev
Browse files Browse the repository at this point in the history
Minor revisions to improve install
  • Loading branch information
bl-young authored Feb 6, 2024
2 parents 23264b5 + 37e1c1c commit 12595ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions R/UtilityFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ findLatestStateIODataonDataCommons <- function(filename) {
registry <- getRegistryonDataCommons(data_group = "stateio")
f <- registry[startsWith(registry$Key, filename) &
endsWith(registry$Key, ".rds"), ]
f$version <- sub(paste0(filename, "_"), "", f$Key)
f$version <- sub(".[^.]*$", "", f$version)
# sort so latest version on top in case of duplicate LastModified dates
f <- f[order(f$version, decreasing=TRUE), ]
f <- basename(f[which.max(as.Date(f$LastModified)), "Key"])
if (length(f) == 0) {
stop(paste(filename, "not avaialble on Data Commons."))
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ Install the most recent release version of `stateior` and attach it to the curre

```r
install.packages("devtools")
devtools::install_github("USEPA/stateior@0.2.0")
devtools::install_github("USEPA/stateior")
library(stateior)
```

```r
# For a specific release:
devtools::install_github("USEPA/[email protected]")
```

Load desired StateIO data. See [One Region Data](format_specs/OneRegionData.md#data) and [Two Region Data](format_specs/TwoRegionData.md#data) for names and details of one- and two-region MRIO data sets that are currently available, respectively.

```r
Expand Down

0 comments on commit 12595ee

Please sign in to comment.