Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
- Updated .Rd files for functions using `roxygen2::roxygenise()`
- Edited examples for `run_fredi_sv()`
  • Loading branch information
knoiva-indecon committed Nov 25, 2024
1 parent 2d436e3 commit 3c7db74
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 205 deletions.
40 changes: 20 additions & 20 deletions R/run_fredi_sv.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#'
#' @examples
#' ### Run SV Module with defaults without specifying sector
#' df_sv <- run_fredi_sv()
#' # df_sv <- run_fredi_sv()
#'
#' ### Return a character vector with the names of all of the sectors in the FrEDI SV Module:
#' get_sv_sectorInfo()
Expand All @@ -67,16 +67,16 @@
#' data(gcamScenarios)
#'
#' ### Load population scenario
#' data(popDefault)
#' data(popScenario)
#'
#' ### Run SV Module for "Extreme Temperature" with custom population and temperature scenarios
#' df_sv <- run_fredi_sv(sector = "Extreme Temperature", inputsList = list(pop=popDefault, temp=gcamScenarios)
#' df_sv <- run_fredi_sv(sector = "Extreme Temperature", inputsList=list(pop=popScenario, temp=gcamScenarios)
#'
#' ### Run SV Module for "Coastal Properties" with custom population and SLR scenarios
#' df_sv <- run_fredi_sv(sector = "Coastal Properties", inputsList = list(pop=popDefault, slr=gcamScenarios)
#' df_sv <- run_fredi_sv(sector = "Coastal Properties", inputsList=list(pop=popScenario, slr=gcamScenarios)
#'
#' ### Run SV Module for "Coastal Properties" with custom population and temperature scenarios
#' df_sv <- run_fredi_sv(sector = "Coastal Properties", inputsList = list(pop=popDefault, temp=gcamScenarios)
#' df_sv <- run_fredi_sv(sector = "Coastal Properties", inputsList=list(pop=popScenario, temp=gcamScenarios)
#'
#'
#'
Expand Down Expand Up @@ -106,10 +106,10 @@ run_fredi_sv <- function(
.testing = FALSE
){
###### Set up the environment ######
pkgPath <- NULL
pkgPath <- (pkgPath |> is.null()) |> ifelse(system.file(package="FrEDI"), pkgPath);
rDataType <- "rds"
impactsPath <- pkgPath |> file.path("extdata", "sv", "impactLists")
pkgPath <- NULL
pkgPath <- (pkgPath |> is.null()) |> ifelse(system.file(package="FrEDI"), pkgPath);
rDataType <- "rds"
impactsPath <- pkgPath |> file.path("extdata", "sv", "impactLists")

###### ** Load Data Objects ######
### Get FrEDI data objects
Expand All @@ -128,20 +128,20 @@ run_fredi_sv <- function(

### Group types
c_svGroupTypes <- svDataList$c_svGroupTypes
minYear <- minYear0
maxYear <- maxYear0
yearsBy5 <- minYear |> seq(maxYear, by=5)
minYear <- minYear0
maxYear <- maxYear0
yearsBy5 <- minYear |> seq(maxYear, by=5)

### Testing
save <- .testing |> ifelse(FALSE, save)
save <- .testing |> ifelse(FALSE, save)

### Level of messaging (default is to message the user)
silent <- (silent |> is.null()) |> ifelse(T, silent)
msgUser <- !silent
msg0 <- ""
msg1 <- msg0 |> paste0("\t")
msg2 <- msg1 |> paste0("\t")
msg3 <- msg2 |> paste0("\t")
silent <- (silent |> is.null()) |> ifelse(T, silent)
msgUser <- !silent
msg0 <- ""
msg1 <- msg0 |> paste0("\t")
msg2 <- msg1 |> paste0("\t")
msg3 <- msg2 |> paste0("\t")

###### ** State Columns ######
byState <- TRUE
Expand Down Expand Up @@ -239,7 +239,7 @@ run_fredi_sv <- function(
idCols0 <- list(valCols0=valCols0, df0=inputDefs[inNames0]) |> pmap(function(valCols0, df0){
df0 |> names() |> get_matches(y=valCols0, matches=F)
}) |> set_names(inNames0)
valCols0 |> print(); idCols0 |> print()
# valCols0 |> print(); idCols0 |> print()

###### ** Valid Inputs & Input Info ######
### Figure out which inputs are not null, and filter to that list
Expand Down
1 change: 1 addition & 0 deletions man/FrEDI-package.Rd

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

42 changes: 0 additions & 42 deletions man/defaultResults.Rd

This file was deleted.

39 changes: 26 additions & 13 deletions man/gcamScenarios.Rd

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

Loading

0 comments on commit 3c7db74

Please sign in to comment.