Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '528165690'
ValidationKey: '530787363'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package .* was built under R version'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches: [main, master]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main, master]

jobs:
check:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'mrvalidation: madrat data preparation for validation purposes'
version: 2.61.30
date-released: '2025-05-05'
version: 2.61.33
date-released: '2025-08-11'
abstract: Package contains routines to prepare data for validation exercises.
authors:
- family-names: Bodirsky
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mrvalidation
Title: madrat data preparation for validation purposes
Version: 2.61.30
Date: 2025-05-05
Version: 2.61.33
Date: 2025-08-11
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")),
person("Stephen", "Wirth", role = "aut"),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ importFrom(tidyr,drop_na)
importFrom(tidyr,expand_grid)
importFrom(tidyr,nest)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,unnest)
importFrom(tools,file_path_sans_ext)
importFrom(utils,download.file)
Expand Down
2 changes: 1 addition & 1 deletion R/calcNitrogenSurplusByCrop.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcNitrogenBudgetCropland}}
#' \code{\link[mrcommons]{calcNitrogenBudgetCropland}}
#' @examples
#'
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidDemand.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky, Isabelle Weindl
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#'
Expand Down
4 changes: 2 additions & 2 deletions R/calcValidFeed.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link[mrvalidation]{calcValidLivestockShare}}
#' @examples
#' \dontrun{
#' calcOutput("ValidFeed")
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidFeedConversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky, github Copilot
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidGrassLSUha.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Marcos Alves
#' @seealso
#' \code{\link{calcFAOmassbalance}},
#' \code{\link[mrcommons]{calcFAOmassbalance}},
#' @examples
#' \dontrun{
#' calcOutput("ValidGrassLSUha")
Expand Down
59 changes: 0 additions & 59 deletions R/calcValidGrassSoilCarbon.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/calcValidKcal.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky, Kristine Karstens
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidLivestockDemStructure.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Isabelle Weindl
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#'
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidLivestockShare.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidKcal}}
#' @examples
#'
Expand Down
4 changes: 2 additions & 2 deletions R/calcValidManure.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcExcretion}},
#' \code{\link{calcExcretionIPCC}}
#' \code{\link[mrcommons]{calcExcretion}},
#' \code{\link[mrcommons]{calcExcretionIPCC}}
#' @examples
#'
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidNitrogenBudgetCropland.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcNitrogenBudgetCropland}}
#' \code{\link[mrcommons]{calcNitrogenBudgetCropland}}
#' @examples
#' \dontrun{
#' calcOutput("ValidNitrogenBudgetCropland")
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidNitrogenBudgetPasture.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcNitrogenBudgetCropland}}
#' \code{\link[mrcommons]{calcNitrogenBudgetCropland}}
#' @examples
#'
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidPriceAgriculture.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @return List with a magpie object with commodity prices on global and country level.
#' @author Mishko Stevanovic
#' @seealso
#' \code{\link{readIMPACT3.2.2World_Price}}
#' \code{\link[mrcommons]{readIMPACT3.2.2World_Price}}
#' @examples
#'
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidProcessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author David Chen, Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidProduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcFAOmassbalance}},
#' \code{\link[mrcommons]{calcFAOmassbalance}},
#' \code{\link{calcValidDemand}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidSOCDensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Kristine Karstens
#' @seealso
#' \code{\link{calcSOM}}
#' \code{\link[mrcommons]{calcSOM}}
#' \code{\link{calcValidSOCStocks}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidSOCStocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky, Kristine Karstens
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidLivestockShare}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidSSPResults.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Kristine Karstens
#' @seealso
#' \code{\link{convertSSPResults}}
#' \code{\link[mrcommons]{convertSSPResults}}
#' @examples
#'
#' \dontrun{
Expand Down
3 changes: 1 addition & 2 deletions R/calcValidSelfsuff.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
calcValidSelfsuff <- function(datasource = "FAO", detail = TRUE) {

if (datasource == "FAO") {
kTrade <- findset("k_trade")
mb2 <- collapseNames(calcOutput("FAOmassbalance", aggregate = FALSE)[, , kTrade][, , "dm"])
mb2 <- collapseNames(calcOutput("FAOmassbalance", aggregate = FALSE)[, , "dm"])

# self sufficiency
tmp1 <- round(collapseNames(mb2[, , c("production")]), 8)
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidTrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky, Xiaoxi Wang, David M Chen
#' @seealso
#' \code{\link{calcFAOmassbalance}},
#' \code{\link[mrcommons]{calcFAOmassbalance}},
#' \code{\link{calcValidDemand}}
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/calcValidVegfruitShare.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcFoodSupplyPast}},
#' \code{\link[mrcommons]{calcFoodSupplyPast}},
#' \code{\link{calcValidKcal}}
#' @examples
#'
Expand Down
4 changes: 2 additions & 2 deletions R/calcValidYield.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#' Max.&Min. values alongwith description.
#' @author Abhijeet Mishra, Isabelle Weindl, Florian Humpenoeder
#' @seealso
#' \code{\link{calcFAOmassbalance}},
#' \code{\link{calcCroparea}}
#' \code{\link[mrcommons]{calcFAOmassbalance}},
#' \code{\link[mrlandcore]{calcCroparea}}
#'
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/convertGMIA.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return Global Map on Irrigation data as MAgPIE object on country level Missing values are added as NA
#'
#' @author Stephen Wirth
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#' \dontrun{
#' a <- readSource("GlobalIrrigationMap", "all_data_national")
Expand Down
2 changes: 1 addition & 1 deletion R/convertGasser.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @param x MAgPIE object containing Gasser emissions data
#' @return Historical LUC emission data
#' @author Abhijeet Mishra
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#'
#' @importFrom madrat toolCountryFill

Expand Down
2 changes: 1 addition & 1 deletion R/convertHID.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param subtype : No subtype needed
#' @return Irrigated Area data as MAgPIE object on country level Missing values are added as NA
#' @author Stephen Wirth
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @importFrom madrat getISOlist
#' @examples
#'
Expand Down
2 changes: 1 addition & 1 deletion R/convertIMPACTIrrigInvCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#'
#' @author Felicitas Beier
#'
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#' \dontrun{
#' a <- readSource("IMPACTIrrigInvCosts", convert = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/convertPardeyAgRD.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param x MAgPIE object containing PardeyRD data
#' @return magpie object containing expenditure in Ag R&D, 2009 USD PPP
#' @author David Chen
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#'
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/convertWaterUsage.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param subtype : No subtype needed
#' @return Data on water use as MAgPIE object on country level Missing values are added as NA
#' @author Stephen Wirth
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#' \dontrun{
#' a <- readSource("WaterUsage", "aquastat_2008_12")
Expand Down
2 changes: 1 addition & 1 deletion R/correctGMIA.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param subtype : subtypes are the same as in readGMIA
#' @return Global Map on Irrigation data as MAgPIE object at a 0.5 Degree resolution.
#' @author Stephen Wirth
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#' \dontrun{
#' a <- readSource("IrrigatedArea")
Expand Down
2 changes: 1 addition & 1 deletion R/correctHID.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param subtype : subtypes are the same as in readGMIA
#' @return Global Map on Irrigation data as MAgPIE object at a 0.5 Degree resolution.
#' @author Stephen Wirth
#' @seealso \code{\link{readSource}}
#' @seealso \code{\link[madrat]{readSource}}
#' @examples
#' \dontrun{
#' a <- readSource("IrrigatedArea")
Expand Down
6 changes: 1 addition & 5 deletions R/fullVALIDATION.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' \code{\link[base]{numeric_version}} when called via \code{\link[madrat]{retrieveData}}.
#' @author Jan Philipp Dietrich, Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{readSource}},\code{\link{getCalculations}},\code{\link{calcOutput}}
#' \code{\link[madrat]{readSource}},\code{\link[madrat]{getCalculations}},\code{\link[madrat]{calcOutput}}
#' @examples
#' \dontrun{
#' retrieveData("Validation")
Expand Down Expand Up @@ -211,10 +211,6 @@ fullVALIDATION <- function(rev = 0.1) {
# Carbon Stocks
calcOutput("ValidCarbon", datasource = "LPJmL4_for_MAgPIE_44ac93de:GSWP3-W5E5:historical", aggregate = "REG+GLO",
file = valfile, append = TRUE, try = TRUE)
# calcOutput("ValidGrassSoilCarbon", datasource = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", model = "c7491e",
# lpjml = "lpjml5p2_pasture", aggregate = FALSE, file = valfile, append = TRUE, try = TRUE)
# Temporaraly swiched off for debugging


# Growing Stocks
calcOutput("ValidGS", datasource = "FAO", aggregate = "REG+GLO", indicator = "relative",
Expand Down
Loading