Skip to content

Commit

Permalink
NTEMS documentation, change default val
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmseddy committed Mar 6, 2024
1 parent aa08b03 commit b50ec27
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ URL:
https://landr.predictiveecology.org,
https://github.com/PredictiveEcology/LandR
Date: 2023-11-23
Version: 1.1.0.9079
Version: 1.1.0.9080
Authors@R: c(
person("Eliot J B", "McIntire", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6914-8316")),
Expand Down
14 changes: 7 additions & 7 deletions R/prepInputs_NTEMS.R
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# utils::globalVariables(c(
# "foo"
# ))
utils::globalVariables(c(
"currentLCC"
))

#' Obtain an LCC layer for a given year from NTEMS, with forest matching the FAO definition
#'
#' @inheritParams reproducible::postProcessTo
#' @param year stack of species layers rasters
#' @param rasterToMatch template raster to crop to
#' @param destinationPath destination folder for FAO and LCC data
#' @param disturbedCode value assigned to pixels that are forest per FAO definition but not in LCC year
#' @param ... passed to `prepInputs`
#'
#' @return
#' A \code{SpatRaster} with corrected forest pixels
#'
#' @export
#' @importFrom reproducible prepInputs
#'
prepInputs_NTEMS_LCC_FAO <- function(year = 2010, disturbedCode = 0, rasterToMatch, ...) {
prepInputs_NTEMS_LCC_FAO <- function(year = 2010, disturbedCode = 1, ...) {
if (year > 2019 | year < 1984) {
stop("LCC for this year is unavailable")
}
Expand Down Expand Up @@ -50,11 +48,13 @@ prepInputs_NTEMS_LCC_FAO <- function(year = 2010, disturbedCode = 0, rasterToMat
#' @param endYear NTEMS LCC year to use for correcting transition from bare to non-forest
#' @param lccToAdjust lcc values of the bare class
#' @param nonforestLCC allowable lcc values for bare to become
#' @param ... non-spatial arguments passed to `prepInputs` e.g. destinationPath
#' @return
#' A \code{SpatRaster} with non-flammable pixels corrected if they become flammable non-forest
#'
#' @export
#' @importFrom data.table data.table setnames
#' @importFrom terra ncell
prepInputs_NTEMS_Nonforest <- function(rstLCC, endYear = 2019, lccToAdjust = 33,
nonforestLCC = c(50, 100), ...) {

Expand Down
10 changes: 2 additions & 8 deletions man/prepInputs_NTEMS_LCC_FAO.Rd

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

16 changes: 14 additions & 2 deletions man/prepInputs_NTEMS_Nonforest.Rd

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

0 comments on commit b50ec27

Please sign in to comment.