diff --git a/.buildlibrary b/.buildlibrary index 9d144e3..e7ff002 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '220716090' +ValidationKey: '22437280' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index b2de79a..2695d0a 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'mrwater: madrat based MAgPIE water Input Data Library' -version: 1.11.22 -date-released: '2024-05-02' +version: 1.13.0 +date-released: '2024-05-13' abstract: Provides functions for MAgPIE cellular input data generation and stand-alone water calculations. authors: diff --git a/DESCRIPTION b/DESCRIPTION index cdb85d3..9b5fd0a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,11 @@ Type: Package Package: mrwater Title: madrat based MAgPIE water Input Data Library -Version: 1.11.22 +Version: 1.13.0 URL: https://github.com/pik-piam/mrwater, https: //doi.org/10.5281/zenodo.5801680 License: LGPL-3 | file LICENSE -Date: 2024-05-02 +Date: 2024-05-13 Authors@R: c(person("Felicitas", "Beier", email = "beier@pik-potsdam.de", role = c("aut","cre")), person("Jens", "Heinke", email = "heinke@pik-potsdam.de", role = "aut"), person("Kristine", "Karstens", email = "karstens@pik-potsdam.de", role = "aut"), @@ -17,11 +17,12 @@ Depends: R (>= 2.10.0), madrat (>= 1.72), magclass (>= 6.0.0), - mrcommons (>= 1.37.0), - mrland (>= 0.51.0) + mrcommons (>= 1.41.0), + mrlandcore (>= 1.0.0), + mrland (>= 0.59.0) Imports: magpiesets, - mstools, + mstools (>= 0.6.0), raster, stats, stringr, diff --git a/NAMESPACE b/NAMESPACE index b35d7ac..06f7e8a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ import(madrat) import(magclass) import(mrcommons) import(mrland) +import(mrlandcore) importFrom(madrat,calcOutput) importFrom(madrat,readSource) importFrom(madrat,toolAggregate) @@ -60,13 +61,13 @@ importFrom(magclass,time_interpolate) importFrom(magclass,where) importFrom(magpiesets,addLocation) importFrom(magpiesets,findset) -importFrom(mrcommons,toolCell2isoCell) -importFrom(mrcommons,toolCoord2Isocell) -importFrom(mrcommons,toolGetMappingCoord2Country) -importFrom(mrcommons,toolHarmonize2Baseline) -importFrom(mrcommons,toolLPJmLVersion) -importFrom(mrcommons,toolSmooth) +importFrom(mrlandcore,toolLPJmLVersion) +importFrom(mstools,toolCell2isoCell) +importFrom(mstools,toolCoord2Isocell) +importFrom(mstools,toolGetMappingCoord2Country) +importFrom(mstools,toolHarmonize2Baseline) importFrom(mstools,toolHoldConstant) +importFrom(mstools,toolSmooth) importFrom(raster,brick) importFrom(stats,lm) importFrom(stats,quantile) diff --git a/R/calcAreaPotIrrig.R b/R/calcAreaPotIrrig.R index dc5f1a2..3b97f6f 100644 --- a/R/calcAreaPotIrrig.R +++ b/R/calcAreaPotIrrig.R @@ -27,8 +27,7 @@ #' #' @importFrom madrat calcOutput toolSplitSubtype #' @importFrom magclass collapseNames getCells getYears getNames dimSums time_interpolate -#' @importFrom mrcommons toolGetMappingCoord2Country -#' @importFrom mstools toolHoldConstant +#' @importFrom mstools toolHoldConstant toolGetMappingCoord2Country calcAreaPotIrrig <- function(selectyears, comagyear, iniyear, landScen) { @@ -66,7 +65,7 @@ calcAreaPotIrrig <- function(selectyears, comagyear, iniyear, landScen) { # urbanLand <- calcOutput("UrbanLandFuture", subtype = "LUH2v2", # timestep = "yearly", cells = "lpjcell", # aggregate = FALSE)[, selectyears, ] - # getItems(urbanLand, dim = 3) <- gsub("SSP", "ssp", getItems(urbanLand, dim = 3)) + # getItems(urbanLand, dim = 3) <- gsub("SSP", "ssp", getItems(urbanLand, dim = 3)) # nolint: comment_code_linter # Read in suitable land for irrigation based on Zabel [in mio. ha] # excluding land that is marginal under irrigated conditions (< suitability index of 0.33) diff --git a/R/calcAvlWater.R b/R/calcAvlWater.R index f68de12..1fa1f0c 100755 --- a/R/calcAvlWater.R +++ b/R/calcAvlWater.R @@ -12,7 +12,8 @@ #' #' @import magclass #' @import madrat -#' @importFrom mrcommons toolHarmonize2Baseline toolLPJmLVersion +#' @importFrom mstools toolHarmonize2Baseline +#' @importFrom mrlandcore toolLPJmLVersion #' #' @return magpie object in cellular resolution #' @author Felicitas Beier, Kristine Karstens, Abhijeet Mishra @@ -43,27 +44,27 @@ calcAvlWater <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = if (stage %in% c("raw", "smoothed")) { ### Monthly Discharge (unit (after calcLPJmL): mio. m^3/month) monthDischargeMAG <- calcOutput("LPJmL_new", subtype = "mdischarge", - stage = "raw", - version = lpjmlReadin["natveg"], - climatetype = climatetype, - aggregate = FALSE) + stage = "raw", + version = lpjmlReadin["natveg"], + climatetype = climatetype, + aggregate = FALSE) ### Monthly Runoff (unit (after calcLPJmL): mio. m^3/month) monthRunoffMAG <- calcOutput("LPJmL_new", subtype = "mrunoff", - stage = "raw", - version = lpjmlReadin["natveg"], - climatetype = climatetype, - aggregate = FALSE) + stage = "raw", + version = lpjmlReadin["natveg"], + climatetype = climatetype, + aggregate = FALSE) ## River basin water allocation algorithm: # Read in river structure rs <- readRDS(system.file("extdata/riverstructure_stn_coord.rds", - package = "mrwater")) + package = "mrwater")) basinCode <- rs$endcell if (any(paste(getItems(monthRunoffMAG, dim = "x", full = TRUE), - getItems(monthRunoffMAG, dim = "y", full = TRUE), - sep = ".") != rs$coordinates)) { + getItems(monthRunoffMAG, dim = "y", full = TRUE), + sep = ".") != rs$coordinates)) { stop("Wrong cell ordering of basin in calcAvlWater.R") } @@ -133,8 +134,8 @@ calcAvlWater <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = # Growing days per month growDAYS <- calcOutput("GrowingPeriod", cells = "lpjcell", - lpjml = lpjmlReadin, climatetype = climatetype, - stage = stage, yield_ratio = 0.1, aggregate = FALSE) + lpjml = lpjmlReadin, climatetype = climatetype, + stage = stage, yield_ratio = 0.1, aggregate = FALSE) # Adjust years yearsWAT <- getYears(dailyAvlWat) diff --git a/R/calcCropAreaPotIrrig.R b/R/calcCropAreaPotIrrig.R index d504d0d..3e7273f 100644 --- a/R/calcCropAreaPotIrrig.R +++ b/R/calcCropAreaPotIrrig.R @@ -31,7 +31,7 @@ #' #' @importFrom madrat calcOutput toolSplitSubtype #' @importFrom magclass collapseNames getCells getYears getNames dimSums -#' @importFrom mrcommons toolGetMappingCoord2Country +#' @importFrom mstools toolGetMappingCoord2Country calcCropAreaPotIrrig <- function(selectyears, comagyear, iniyear, cropmix, landScen) { diff --git a/R/calcCropAreaShare.R b/R/calcCropAreaShare.R index d63559c..060990a 100644 --- a/R/calcCropAreaShare.R +++ b/R/calcCropAreaShare.R @@ -19,13 +19,13 @@ #' #' @importFrom madrat calcOutput toolGetMapping #' @importFrom magclass collapseNames getCells getSets getYears getNames new.magpie dimSums -#' @importFrom mrcommons toolCell2isoCell toolGetMappingCoord2Country +#' @importFrom mstools toolCell2isoCell toolGetMappingCoord2Country calcCropAreaShare <- function(iniyear, cropmix) { # read physical croparea croparea <- calcOutput("CropareaAdjusted", iniyear = iniyear, - aggregate = FALSE) + aggregate = FALSE) # total croparea (irrigated + rainfed) totCroparea <- dimSums(croparea, dim = "irrigation") diff --git a/R/calcCropareaAdjusted.R b/R/calcCropareaAdjusted.R index fd40022..b8c6f06 100644 --- a/R/calcCropareaAdjusted.R +++ b/R/calcCropareaAdjusted.R @@ -18,7 +18,7 @@ #' #' @importFrom madrat calcOutput #' @importFrom magclass getCells getNames add_dimension new.magpie -#' @importFrom mrcommons toolGetMappingCoord2Country +#' @importFrom mstools toolGetMappingCoord2Country calcCropareaAdjusted <- function(iniyear, dataset = "LandInG", sectoral = "kcr") { diff --git a/R/calcEnvmtlFlowRequirementsShare.R b/R/calcEnvmtlFlowRequirementsShare.R index bb03b91..f400be3 100644 --- a/R/calcEnvmtlFlowRequirementsShare.R +++ b/R/calcEnvmtlFlowRequirementsShare.R @@ -10,7 +10,7 @@ #' #' @importFrom magclass collapseNames new.magpie getYears setYears as.array as.magpie add_dimension mbind #' @importFrom madrat calcOutput -#' @importFrom mrcommons toolLPJmLVersion +#' @importFrom mrlandcore toolLPJmLVersion #' @importFrom stats quantile #' #' @return magpie object in cellular resolution representing share of discharge diff --git a/R/calcFullIrrigationRequirement.R b/R/calcFullIrrigationRequirement.R index 3ec3bdf..d2ca5ee 100644 --- a/R/calcFullIrrigationRequirement.R +++ b/R/calcFullIrrigationRequirement.R @@ -14,8 +14,8 @@ #' or drip, surface, sprinkler for full irrigation by selected system #' @param landScen Land availability scenario consisting of two parts separated by ":": #' 1. available land scenario (currCropland, currIrrig, potCropland) -#' 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, -#' e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, +#' 2. protection scenario (WDPA, or one of the scenarios available in +#' calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, #' or NA for no protection). #' For case of no land protection select "NA" in second part of argument #' or do not specify second part of the argument @@ -47,7 +47,7 @@ #' #' @importFrom madrat calcOutput toolGetMapping #' @importFrom magclass collapseNames getItems new.magpie dimSums -#' @importFrom mrcommons toolCell2isoCell toolGetMappingCoord2Country +#' @importFrom mstools toolCell2isoCell toolGetMappingCoord2Country calcFullIrrigationRequirement <- function(lpjml, climatetype, selectyears, iniyear, comagyear, diff --git a/R/calcGrowingPeriod.R b/R/calcGrowingPeriod.R index 9ccd960..98e8c26 100644 --- a/R/calcGrowingPeriod.R +++ b/R/calcGrowingPeriod.R @@ -19,7 +19,8 @@ #' #' @importFrom madrat toolGetMapping toolAggregate #' @importFrom magclass collapseNames getItems new.magpie getYears dimSums magpie_expand -#' @importFrom mrcommons toolHarmonize2Baseline toolSmooth toolLPJmLVersion toolGetMappingCoord2Country +#' @importFrom mstools toolHarmonize2Baseline toolSmooth toolGetMappingCoord2Country +#' @importFrom mrlandcore toolLPJmLVersion #' #' @export @@ -37,7 +38,7 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = unname(cfgCrop$readin_version)) lpjmlBaseline <- c(natveg = unname(cfgNatveg$baseline_version), - crop = unname(cfgCrop$baseline_version)) + crop = unname(cfgCrop$baseline_version)) if (stage %in% c("raw", "smoothed")) { @@ -62,8 +63,8 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", #################################################################################### lpj2mag <- toolGetMapping("MAgPIE_LPJmL.csv", - type = "sectoral", - where = "mappingfolder") + type = "sectoral", + where = "mappingfolder") # Read yields first yields <- collapseNames(calcOutput("LPJmL_new", version = lpjmlReadin["crop"], @@ -72,11 +73,11 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", # Load Sowing dates from LPJmL (use just rainfed dates since they do not differ for irrigated and rainfed) sowd <- collapseNames(calcOutput("LPJmL_new", version = lpjmlReadin["crop"], - climatetype = climatetype, subtype = "sdate", - stage = "raw", aggregate = FALSE)[, , "rainfed"]) + climatetype = climatetype, subtype = "sdate", + stage = "raw", aggregate = FALSE)[, , "rainfed"]) hard <- collapseNames(calcOutput("LPJmL_new", version = lpjmlReadin["crop"], - climatetype = climatetype, subtype = "hdate", - stage = "raw", aggregate = FALSE)[, , "rainfed"]) + climatetype = climatetype, subtype = "hdate", + stage = "raw", aggregate = FALSE)[, , "rainfed"]) goodCrops <- lpj2mag$MAgPIE[which(lpj2mag$LPJmL %in% getItems(sowd, dim = 3))] badCrops <- lpj2mag$MAgPIE[which(!lpj2mag$LPJmL %in% getItems(sowd, dim = 3))] @@ -93,7 +94,7 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", if (length(badCrops) > 0) { vcat(2, "No information on the growing period found for those crops: ", - paste(unique(badCrops), collapse = ", ")) + paste(unique(badCrops), collapse = ", ")) } ##################################################################################### @@ -123,8 +124,8 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", yields <- collapseNames(yields[, , goodCrops]) cell2GLO <- array(c(getItems(yields, dim = 1), - rep("GLO", length(getItems(yields, dim = 1)))), - dim = c(length(getItems(yields, dim = 1)), 2)) + rep("GLO", length(getItems(yields, dim = 1)))), + dim = c(length(getItems(yields, dim = 1)), 2)) gloYields <- toolAggregate(yields, cell2GLO, weight = setYears(area, NULL)) yieldsRatio <- yields / gloYields @@ -152,9 +153,8 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", # define all crops sowed after 180 days and where sowing date is after harvest date as wintercrops rmWintercrops[cellsNrthnHem, , ] <- ifelse(sowd[cellsNrthnHem, , ] > 180 & - hard[cellsNrthnHem, , ] < sowd[cellsNrthnHem, , ], - NA, - 1) + hard[cellsNrthnHem, , ] < sowd[cellsNrthnHem, , ], + NA, 1) #################################################################################### @@ -240,9 +240,9 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", # mag object for the growing days per month growdaysPERmonth <- new.magpie(cells_and_regions = getItems(meanSowd, dim = 1), - years = getItems(meanSowd, dim = 2), - names = month, - fill = 0) + years = getItems(meanSowd, dim = 2), + names = month, + fill = 0) # determine the harvest day, take care if it is greater than 365 meanHard <- (meanSowd + meanGrper - 1) %% 365 @@ -319,8 +319,8 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", } else { x <- calcOutput("GrowingPeriod", lpjml = lpjml, climatetype = climatetype, - stage = "smoothed", yield_ratio = yield_ratio, - cells = "lpjcell", aggregate = FALSE) + stage = "smoothed", yield_ratio = yield_ratio, + cells = "lpjcell", aggregate = FALSE) # Harmonize to baseline out <- toolHarmonize2Baseline(x = x, base = baseline, ref_year = cfgNatveg$ref_year_hist) } @@ -329,8 +329,8 @@ calcGrowingPeriod <- function(lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", # read in historical data for subtype baseline2020 <- calcOutput("GrowingPeriod", lpjml = lpjmlBaseline, climatetype = cfgNatveg$baseline_gcm, - stage = "harmonized", yield_ratio = yield_ratio, - cells = "lpjcell", aggregate = FALSE) + stage = "harmonized", yield_ratio = yield_ratio, + cells = "lpjcell", aggregate = FALSE) if (climatetype == cfgNatveg$baseline_gcm) { diff --git a/R/calcIrrigWatRequirements.R b/R/calcIrrigWatRequirements.R index f79b974..bdd85ef 100644 --- a/R/calcIrrigWatRequirements.R +++ b/R/calcIrrigWatRequirements.R @@ -30,7 +30,7 @@ #' #' @importFrom magclass getItems new.magpie add_dimension #' @importFrom madrat calcOutput toolAggregate toolGetMapping -#' @importFrom mrcommons toolCell2isoCell +#' @importFrom mstools toolCell2isoCell #' @importFrom stringr str_split #' @importFrom withr local_options diff --git a/R/calcWaterUseNonAg.R b/R/calcWaterUseNonAg.R index 55aa0e5..b2889b7 100644 --- a/R/calcWaterUseNonAg.R +++ b/R/calcWaterUseNonAg.R @@ -34,10 +34,10 @@ #' #' @importFrom madrat calcOutput readSource toolTimeAverage toolTimeSpline toolFillYears #' @importFrom magclass new.magpie getYears getCells getSets setYears dimOrder -#' @importFrom mrcommons toolCell2isoCell toolCoord2Isocell toolGetMappingCoord2Country toolHarmonize2Baseline +#' @importFrom mstools toolCell2isoCell toolCoord2Isocell toolGetMappingCoord2Country toolHarmonize2Baseline #' @importFrom magpiesets addLocation findset -calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lpjcell", +calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lpjcell", # nolint: cyclocomp_linter datasource = "WATCH_ISIMIP_WATERGAP", usetype = "all", seasonality = "grper", harmonType = "average", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", @@ -147,7 +147,7 @@ calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lp # Note: ISIMIP industry data = manufacturing + electricity # Store WATERGAP share of manufacturing and electricity of industry watdemIndustry <- collapseNames(watdemWATERGAP[, , "manufacturing"]) + - collapseNames(watdemWATERGAP[, , "electricity"]) + collapseNames(watdemWATERGAP[, , "electricity"]) shrManufacturing <- ifelse(watdemIndustry > 0, watdemWATERGAP[, , "manufacturing"] / watdemIndustry, 0) @@ -181,9 +181,9 @@ calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lp tmp <- vector(mode = "list", length = 3) tmp[[1]] <- harmonizedWATERGAP[, yearsWATERGAP, "domestic"] tmp[[2]] <- shrManufacturing[, yearsWATERGAP, scenario] * - collapseNames(harmonizedWATERGAP[, yearsWATERGAP, "industry"]) + collapseNames(harmonizedWATERGAP[, yearsWATERGAP, "industry"]) tmp[[3]] <- shrElectricity[, yearsWATERGAP, scenario] * - collapseNames(harmonizedWATERGAP[, yearsWATERGAP, "industry"]) + collapseNames(harmonizedWATERGAP[, yearsWATERGAP, "industry"]) # Store MAgPIE objects in list i <- i + 1 @@ -244,10 +244,10 @@ calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lp tmp <- vector(mode = "list", length = 3) tmp[[1]] <- watdemISIMIP[, yearsHist, "domestic"] tmp[[2]] <- collapseNames(watdemISIMIP[, yearsHist, "industry"]) * - collapseNames(setYears(shrManufacturing[, baseyear, "ssp2"], NULL)) + collapseNames(setYears(shrManufacturing[, baseyear, "ssp2"], NULL)) getNames(tmp[[2]]) <- paste("manufacturing", getNames(tmp[[2]]), sep = ".") tmp[[3]] <- collapseNames(watdemISIMIP[, yearsHist, "industry"]) * - collapseNames(setYears(shrElectricity[, baseyear, "ssp2"], NULL)) + collapseNames(setYears(shrElectricity[, baseyear, "ssp2"], NULL)) getNames(tmp[[3]]) <- paste("electricity", getNames(tmp[[3]]), sep = ".") watdemNonAg <- mbind(tmp) @@ -257,10 +257,10 @@ calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lp tmp <- vector(mode = "list", length = 3) tmp[[1]] <- watdemISIMIP[, yearsWATERGAP, "domestic"] tmp[[2]] <- collapseNames(watdemISIMIP[, yearsWATERGAP, "industry"]) * - collapseNames(shrManufacturing[, yearsWATERGAP, "ssp2"]) + collapseNames(shrManufacturing[, yearsWATERGAP, "ssp2"]) getNames(tmp[[2]]) <- paste("manufacturing", getNames(tmp[[2]]), sep = ".") tmp[[3]] <- collapseNames(watdemISIMIP[, yearsWATERGAP, "industry"]) * - collapseNames(shrElectricity[, yearsWATERGAP, "ssp2"]) + collapseNames(shrElectricity[, yearsWATERGAP, "ssp2"]) getNames(tmp[[3]]) <- paste("electricity", getNames(tmp[[3]]), sep = ".") tmp <- mbind(tmp) @@ -340,7 +340,7 @@ calcWaterUseNonAg <- function(selectyears = seq(1995, 2100, by = 5), cells = "lp # Report withdrawal or consumption only if (!is.na(abstractiontype) && - (grepl(abstractiontype, "consumption") || grepl(abstractiontype, "withdrawal"))) { + (grepl(abstractiontype, "consumption") || grepl(abstractiontype, "withdrawal"))) { out <- collapseNames(out[, , abstractiontype]) } diff --git a/R/calcYieldgainPotential.R b/R/calcYieldgainPotential.R index acc8058..6051e5b 100644 --- a/R/calcYieldgainPotential.R +++ b/R/calcYieldgainPotential.R @@ -40,8 +40,8 @@ #' ("surface", "sprinkler", "drip", "initialization") #' @param landScen Land availability scenario consisting of two parts separated by ":": #' 1. available land scenario (currCropland, currIrrig, potCropland) -#' 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, -#' e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, +#' 2. protection scenario (WDPA, or one of the scenarios available in +#' calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, #' or NA for no protection). #' For case of no land protection select "NA" in second part of argument #' or do not specify second part of the argument @@ -80,7 +80,7 @@ #' @importFrom stringr str_split #' @importFrom madrat calcOutput #' @importFrom magclass collapseNames getCells getNames setYears dimSums new.magpie -#' @importFrom mrcommons toolGetMappingCoord2Country +#' @importFrom mstools toolGetMappingCoord2Country #' #' @export diff --git a/R/correctDams.R b/R/correctDams.R index f761900..e060f4d 100644 --- a/R/correctDams.R +++ b/R/correctDams.R @@ -11,7 +11,7 @@ #' } #' #' @importFrom madrat toolConditionalReplace -#' @importFrom mrcommons toolCell2isoCell +#' @importFrom mstools toolCell2isoCell correctDams <- function(x) { diff --git a/R/imports.R b/R/imports.R index 7afad1f..09ee4a5 100644 --- a/R/imports.R +++ b/R/imports.R @@ -1,4 +1,4 @@ # Generated by lucode2: do not edit by hand -#' @import madrat magclass mrcommons mrland +#' @import madrat magclass mrcommons mrlandcore mrland NULL diff --git a/R/readIrrigationSystem.R b/R/readIrrigationSystem.R index fb49589..fbe0ad4 100644 --- a/R/readIrrigationSystem.R +++ b/R/readIrrigationSystem.R @@ -15,11 +15,11 @@ #' #' @importFrom madrat toolCountry2isocode toolCountryFill toolConditionalReplace #' @importFrom magclass getCells -#' @importFrom mrcommons toolGetMappingCoord2Country +#' @importFrom mstools toolGetMappingCoord2Country readIrrigationSystem <- function(subtype = "Jaegermeyr") { - ### ToDo: Can be delted soon. Will be replaced by readJaegermeyr2015 + ### ToDo: Can be delted soon. Will be replaced by readJaegermeyr2015 # nolint: todo_comment_linter # Mapping map <- toolGetMappingCoord2Country() diff --git a/README.md b/README.md index 1796392..fd6cd64 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE water Input Data Library -R package **mrwater**, version **1.11.22** +R package **mrwater**, version **1.13.0** [![CRAN status](https://www.r-pkg.org/badges/version/mrwater)](https://cran.r-project.org/package=mrwater) [![R build status](https://github.com/pik-piam/mrwater/workflows/check/badge.svg)](https://github.com/pik-piam/mrwater/actions) [![codecov](https://codecov.io/gh/pik-piam/mrwater/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrwater) [![r-universe](https://pik-piam.r-universe.dev/badges/mrwater)](https://pik-piam.r-universe.dev/builds) @@ -50,7 +50,7 @@ In case of questions / problems please contact Felicitas Beier . +Beier F, Heinke J, Karstens K, Bodirsky B, Dietrich J (2024). _mrwater: madrat based MAgPIE water Input Data Library_. R package version 1.13.0, . A BibTeX entry for LaTeX users is @@ -59,7 +59,7 @@ A BibTeX entry for LaTeX users is title = {mrwater: madrat based MAgPIE water Input Data Library}, author = {Felicitas Beier and Jens Heinke and Kristine Karstens and Benjamin Leon Bodirsky and Jan Philipp Dietrich}, year = {2024}, - note = {R package version 1.11.22}, + note = {R package version 1.13.0}, url = {https://github.com/pik-piam/mrwater}, } ``` diff --git a/man/calcFullIrrigationRequirement.Rd b/man/calcFullIrrigationRequirement.Rd index 401a012..8c9e0f2 100644 --- a/man/calcFullIrrigationRequirement.Rd +++ b/man/calcFullIrrigationRequirement.Rd @@ -35,8 +35,8 @@ or drip, surface, sprinkler for full irrigation by selected system} \item{landScen}{Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) -2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, - e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, +2. protection scenario (WDPA, or one of the scenarios available in + calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument} diff --git a/man/calcYieldgainPotential.Rd b/man/calcYieldgainPotential.Rd index 7b7ea02..00ddaea 100644 --- a/man/calcYieldgainPotential.Rd +++ b/man/calcYieldgainPotential.Rd @@ -82,8 +82,8 @@ If FALSE: non-renewable groundwater cannot be used.} \item{landScen}{Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) -2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, - e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, +2. protection scenario (WDPA, or one of the scenarios available in + calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument}