Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
.*\.tar\.gz$
.*\.toc$
.*\.zip$
^\.lintr$


CONTRIBUTING\.md
cran-comments\.md
^docs$
^LICENSE$
vignettes/.*_cache$
vignettes/.*\.log$

^\.httr-oauth$
^revdep$
^\.github$
^codecov\.yml$
^CRAN-RELEASE$
^data/*
^.git
^.gitignore

^.gitmodules

Biomass_borealDataPrep.*
.*zip
citation.*
figures
1 change: 1 addition & 0 deletions .github/workflows/render-module-rmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- main
- master
- development
push:
branches:
- main
Expand Down
9 changes: 8 additions & 1 deletion Biomass_borealDataPrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defineModule(sim, list(
loadOrder = list(after = c("Biomass_speciesData"),
before = c("Biomass_core")),
reqdPkgs = list("assertthat", "crayon", "data.table", "dplyr", "fasterize", "ggplot2",
"merTools", "plyr", "rasterVis", "sf", "terra",
"merTools", "plyr", "rasterVis", "sf", "terra", "Require",
"reproducible (>= 2.1.0)",
"SpaDES.core (>= 2.1.0)", "SpaDES.tools (>= 2.0.0)",
"PredictiveEcology/LandR (>= 1.1.1)",
Expand Down Expand Up @@ -1344,6 +1344,13 @@ plottingFn <- function(sim) {
)
}

#' Save files
#'
#' Generic function using `saveFiles`
#'
#' @return For side effect, saved files as per sim
#'
#' @param sim A simList
Save <- function(sim) {
sim <- saveFiles(sim)
return(invisible(sim))
Expand Down
48 changes: 48 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Package: Biomass.borealDataPrep
Type: Package
Title: Biomass_borealDataPrep
Version: 1.5.7.9002
Description: paste A data preparation module for parameterizing `Biomass_core` from open data sources, within the Boreal forest of Canada.
Date: 2024-06-13
Authors@R:
c(person("Yong", "Luo", email = "[email protected]", role = c("aut")),
person(c("Eliot", "J", "B"), "McIntire", email = "[email protected]",
role = c("aut", "cre")), person(c("Ceres"), "Barros",
email = "[email protected]", role = c("aut")), person(c("Alex",
"M."), "Chubaty", email = "[email protected]", role = c("aut")))
Imports:
assertthat,
crayon,
data.table,
dplyr,
fasterize,
ggplot2,
LandR (>= 1.1.1),
merTools,
pemisc,
plyr,
rasterVis,
reproducible (>= 2.1.0),
sf,
SpaDES.core (>= 2.1.0),
SpaDES.project (>= 0.0.8.9026),
SpaDES.tools (>= 2.0.0),
terra
Suggests:
knitr,
RCurl,
rmarkdown,
roxygen2,
testthat,
withr,
XML
Remotes:
PredictiveEcology/LandR,
PredictiveEcology/pemisc@development,
PredictiveEcology/SpaDES.project@development
Encoding: UTF-8
License: GPL-3
VignetteBuilder: knitr, rmarkdown
ByteCompile: yes
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Generated by roxygen2: do not edit by hand

export(spinUpPartial)
import(SpaDES.core)
import(SpaDES.project)
import(SpaDES.tools)
import(assertthat)
import(dplyr)
import(fasterize)
import(ggplot2)
import(pemisc)
import(plyr)
import(rasterVis)
import(reproducible)
import(sf)
import(terra)
importFrom(LandR,asInteger)
importFrom(LandR,subsetDT)
importFrom(crayon,cyan)
Expand Down
42 changes: 42 additions & 0 deletions R/imports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#' @import assertthat
NULL

#' @import dplyr
NULL

#' @import fasterize
NULL


#' @import ggplot2
NULL

#' @import plyr
NULL

#' @import rasterVis
NULL

#' @import sf
NULL


#' @import terra
NULL

#' @import reproducible
NULL

#' @import SpaDES.core
NULL


#' @import SpaDES.tools
NULL

#' @import SpaDES.project
NULL

#' @import pemisc
NULL

4 changes: 3 additions & 1 deletion R/updateYoungBiomasses.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' Update young biomasses
#'
#' @param young data.table not unlinke `cohortData`
#' @param modelBiomass named list with items "mod", "pred", "rsq", "scaledVarsModelB".
#' @param ... For anything, used for Cache. Not used internally here.
Expand Down Expand Up @@ -190,7 +192,7 @@ spinUpPartial <- function(pixelCohortData, speciesEcoregion, maxAge,
} else {
modules <- "Biomass_core"
}

outputs <- data.frame(expand.grid(objectName = "cohortData",
saveTime = unique(seq(times$start, times$end, by = 1)),
eventPriority = 1, fun = "qs::qsave",
Expand Down
51 changes: 51 additions & 0 deletions man/spinUpPartial.Rd

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

18 changes: 18 additions & 0 deletions man/updateYoungBiomasses.Rd

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

2 changes: 2 additions & 0 deletions tests/test-all.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library(testthat)
test_check("Biomass.borealDataPrep")
Loading