Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6183e6d
...
bodirsky Mar 4, 2026
a72eb7f
...
bodirsky Mar 4, 2026
d78c638
.
bodirsky Mar 5, 2026
6d13633
..
bodirsky Mar 13, 2026
b57c753
.
bodirsky Mar 20, 2026
3e1759a
Merge branch 'master' of https://github.com/pik-piam/mrcommons into c…
bodirsky Mar 20, 2026
9d7e98b
.
bodirsky Mar 20, 2026
d1a3b01
..
bodirsky Mar 20, 2026
ccc8942
..
bodirsky Mar 21, 2026
2a9eab4
Merge branch 'master' of https://github.com/pik-piam/mrcommons into c…
bodirsky Apr 10, 2026
93d72a3
Merge branch 'master' of https://github.com/pik-piam/mrcommons into c…
bodirsky Apr 10, 2026
980d8f5
...
bodirsky Apr 10, 2026
76f2ad6
merge master into croparea branch
FelicitasBeier May 8, 2026
fbe3356
update gitignore
FelicitasBeier Jun 1, 2026
dfca5ad
merge master into croparea branch
FelicitasBeier Jun 1, 2026
5303a70
merge master into cropareaUpdate branch
FelicitasBeier Jul 8, 2026
fc2acd8
Merge branch 'master' of github.com:pik-piam/mrcommons into cropareaU…
pascal-sauer Jul 14, 2026
409773c
fix calcSNUpE rev
pascal-sauer Jul 14, 2026
4d6acab
dev version
pascal-sauer Jul 14, 2026
58c0d55
linter
pascal-sauer Jul 14, 2026
33ba016
replaced calcLUH3 with calcLandArea in convertISIMIP
mishkos Jul 15, 2026
bd18138
merge master into cropareaUpdate branch
FelicitasBeier Aug 6, 2026
276c890
fix comment in readWCDE that caused warning in madratGraph
FelicitasBeier Aug 6, 2026
d2501c4
calcFAOYield: fix garbled @param areaSource documentation
bodirsky Aug 7, 2026
56e51d0
convertISIMIP: strip trailing whitespace on two blank lines
bodirsky Aug 7, 2026
157381e
calcSOCLossShare: derive the kcr2all mapping length from the crop set…
bodirsky Aug 7, 2026
591b2f6
bugfix in calcClimateClass related to datasource handover
FelicitasBeier Aug 7, 2026
ede8538
Merge branch 'cropareaUpdate' of https://github.com/FelicitasBeier/mr…
bodirsky Aug 10, 2026
a6c95ce
..
bodirsky Aug 10, 2026
7d386db
merged master into cropareaupdate branch
FelicitasBeier Aug 10, 2026
b095939
bugfix in calcSOCLossShare related to climate class datasource
FelicitasBeier Aug 12, 2026
20663d1
correction of typo in comment and formatting
FelicitasBeier Aug 13, 2026
f8ea497
Bugfix in calcProduction: Seychelles were missing from correction
FelicitasBeier Aug 13, 2026
ec6f67b
temporary fix: introduced special exception for HKG in warning. Note:…
FelicitasBeier Aug 13, 2026
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: '35643700'
ValidationKey: '35648872'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.Rhistory
.RData
.Ruserdata
.positai
*.Rproj
.Rproj.user
.positai
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'mrcommons: MadRat commons Input Data Library'
version: 1.72.4
date-released: '2026-08-10'
date-released: '2026-08-13'
abstract: Provides useful functions and a common structure to all the input data required
to run models like MAgPIE and REMIND of model input data.
authors:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: mrcommons
Title: MadRat commons Input Data Library
Version: 1.72.4
Date: 2026-08-10
Date: 2026-08-13
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = "aut"),
person("Kristine", "Karstens", role = "aut"),
Expand Down
314 changes: 139 additions & 175 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,183 +31,147 @@ import(mrfaocore)
import(mrlandcore)
import(mstools)
importFrom(countrycode,countrycode)
importFrom(data.table,
as.data.table,
fread
)
importFrom(dplyr,
"%>%",
across,
arrange,
count,
distinct,
filter,
full_join,
group_by,
inner_join,
last,
left_join,
mutate,
mutate_all,
n,
recode,
relocate,
rename,
right_join,
select,
summarise
)
importFrom(data.table,as.data.table)
importFrom(data.table,fread)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,arrange)
importFrom(dplyr,count)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,group_by)
importFrom(dplyr,inner_join)
importFrom(dplyr,last)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
importFrom(dplyr,n)
importFrom(dplyr,recode)
importFrom(dplyr,relocate)
importFrom(dplyr,rename)
importFrom(dplyr,right_join)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(hdf5r,h5file)
importFrom(luscale,
getAggregationMatrix,
groupAggregate,
rename_dimnames
)
importFrom(madrat,
calcOutput,
metadataGFZ,
readSource,
regionscode,
toolAggregate,
toolConditionalReplace,
toolCountry2isocode,
toolCountryFill,
toolGetMapping,
toolNAreplace,
toolSplitSubtype,
toolSubtypeSelect
)
importFrom(magclass,
"getItems<-",
"getNames<-",
"getYears<-",
add_columns,
add_dimension,
as.magpie,
clean_magpie,
collapseDim,
collapseNames,
convergence,
dimOrder,
dimReduce,
dimSums,
getCPR,
getCells,
getCoords,
getItems,
getNames,
getRegions,
getSets,
getYears,
hasCoords,
magpie_expand,
mbind,
mselect,
new.magpie,
read.magpie,
read.report,
setCells,
setNames,
setYears,
time_interpolate,
where,
wrap
)
importFrom(magpiesets,
FRAnames,
addLocation,
findset,
reporthelper,
reportingnames
)
importFrom(luscale,getAggregationMatrix)
importFrom(luscale,groupAggregate)
importFrom(luscale,rename_dimnames)
importFrom(madrat,calcOutput)
importFrom(madrat,metadataGFZ)
importFrom(madrat,readSource)
importFrom(madrat,regionscode)
importFrom(madrat,toolAggregate)
importFrom(madrat,toolConditionalReplace)
importFrom(madrat,toolCountry2isocode)
importFrom(madrat,toolCountryFill)
importFrom(madrat,toolGetMapping)
importFrom(madrat,toolNAreplace)
importFrom(madrat,toolSplitSubtype)
importFrom(madrat,toolSubtypeSelect)
importFrom(magclass,"getItems<-")
importFrom(magclass,"getNames<-")
importFrom(magclass,"getYears<-")
importFrom(magclass,add_columns)
importFrom(magclass,add_dimension)
importFrom(magclass,as.magpie)
importFrom(magclass,clean_magpie)
importFrom(magclass,collapseDim)
importFrom(magclass,collapseNames)
importFrom(magclass,convergence)
importFrom(magclass,dimOrder)
importFrom(magclass,dimReduce)
importFrom(magclass,dimSums)
importFrom(magclass,getCPR)
importFrom(magclass,getCells)
importFrom(magclass,getCoords)
importFrom(magclass,getItems)
importFrom(magclass,getNames)
importFrom(magclass,getRegions)
importFrom(magclass,getSets)
importFrom(magclass,getYears)
importFrom(magclass,hasCoords)
importFrom(magclass,magpie_expand)
importFrom(magclass,mbind)
importFrom(magclass,mselect)
importFrom(magclass,new.magpie)
importFrom(magclass,read.magpie)
importFrom(magclass,read.report)
importFrom(magclass,setCells)
importFrom(magclass,setNames)
importFrom(magclass,setYears)
importFrom(magclass,time_interpolate)
importFrom(magclass,where)
importFrom(magclass,wrap)
importFrom(magpiesets,FRAnames)
importFrom(magpiesets,addLocation)
importFrom(magpiesets,findset)
importFrom(magpiesets,reporthelper)
importFrom(magpiesets,reportingnames)
importFrom(methods,new)
importFrom(mstools,toolGetMappingCoord2Country)
importFrom(ncdf4,
nc_close,
nc_open,
ncvar_get
)
importFrom(purrr,
map,
map2,
pmap,
walk
)
importFrom(quitte,
as.quitte,
inline.data.frame
)
importFrom(raster,
"res<-",
aggregate,
area,
as.matrix,
brick,
crs,
extent,
projectRaster,
raster,
res,
resample,
stack,
subset,
writeRaster
)
importFrom(readxl,
read_excel,
read_xlsx
)
importFrom(reshape2,
acast,
dcast,
melt
)
importFrom(ncdf4,nc_close)
importFrom(ncdf4,nc_open)
importFrom(ncdf4,ncvar_get)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,pmap)
importFrom(purrr,walk)
importFrom(quitte,as.quitte)
importFrom(quitte,inline.data.frame)
importFrom(raster,"res<-")
importFrom(raster,aggregate)
importFrom(raster,area)
importFrom(raster,as.matrix)
importFrom(raster,brick)
importFrom(raster,crs)
importFrom(raster,extent)
importFrom(raster,projectRaster)
importFrom(raster,raster)
importFrom(raster,res)
importFrom(raster,resample)
importFrom(raster,stack)
importFrom(raster,subset)
importFrom(raster,writeRaster)
importFrom(readxl,read_excel)
importFrom(readxl,read_xlsx)
importFrom(reshape2,acast)
importFrom(reshape2,dcast)
importFrom(reshape2,melt)
importFrom(rlang,.data)
importFrom(stats,
na.omit,
quantile,
reshape,
xtabs
)
importFrom(stringr,
str_detect,
str_extract,
str_sub
)
importFrom(terra,
app,
classify,
focal,
rast,
rasterize,
segregate,
subset,
terraOptions,
tmpFiles,
vect
)
importFrom(tidyr,
expand_grid,
matches,
pivot_longer,
starts_with,
unnest
)
importFrom(utils,
bibentry,
capture.output,
download.file,
head,
person,
read.csv,
read.csv2,
read.table,
tail,
unzip
)
importFrom(withr,
defer,
local_options,
local_tempdir
)
importFrom(stats,na.omit)
importFrom(stats,quantile)
importFrom(stats,reshape)
importFrom(stats,xtabs)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_sub)
importFrom(terra,app)
importFrom(terra,classify)
importFrom(terra,focal)
importFrom(terra,rast)
importFrom(terra,rasterize)
importFrom(terra,segregate)
importFrom(terra,subset)
importFrom(terra,terraOptions)
importFrom(terra,tmpFiles)
importFrom(terra,vect)
importFrom(tidyr,expand_grid)
importFrom(tidyr,matches)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,starts_with)
importFrom(tidyr,unnest)
importFrom(utils,bibentry)
importFrom(utils,capture.output)
importFrom(utils,download.file)
importFrom(utils,head)
importFrom(utils,person)
importFrom(utils,read.csv)
importFrom(utils,read.csv2)
importFrom(utils,read.table)
importFrom(utils,tail)
importFrom(utils,unzip)
importFrom(withr,defer)
importFrom(withr,local_options)
importFrom(withr,local_tempdir)
importFrom(zoo,na.locf)
6 changes: 4 additions & 2 deletions R/calcClimateClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ calcClimateClass <- function(datasource = "koeppen") {
getNames(x) <- gsub(" ", "_", tolower(getNames(x)))

if (grepl("ipccReduced", datasource)) {
reduceIPCC <- toolGetMapping("IPCC2IPCCreduced.csv", type = "sectoral", where = "mappingfolder")
x <- toolAggregate(x, reduceIPCC, from = "ipcc", to = datasource, dim = 3, partrel = TRUE)
reduceIPCC <- toolGetMapping("IPCC2IPCCreduced.csv", type = "sectoral",
where = "mappingfolder")
x <- toolAggregate(x, reduceIPCC, from = "ipcc",
to = datasource, dim = 3, partrel = TRUE)
}

} else {
Expand Down
Loading