Skip to content

Commit

Permalink
FAO2LUH2MAG_croptypes.csv mapping moved from mrcommons to mrlandcore
Browse files Browse the repository at this point in the history
  • Loading branch information
mscrawford committed Oct 18, 2024
1 parent 8371a34 commit 21dcf45
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1100550'
ValidationKey: '1200840'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
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: 'mrfactors: MADRaT based package on factor inputs'
version: 0.5.5
date-released: '2024-10-14'
version: 0.6.0
date-released: '2024-10-18'
abstract: This package provides functions for MAgPIE input data on factor inputs to
agricultural production (with a focus on capital and labor).
authors:
Expand Down
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mrfactors
Title: MADRaT based package on factor inputs
Version: 0.5.5
Date: 2024-10-14
Version: 0.6.0
Date: 2024-10-18
Authors@R:
c(person("Debbora", "Leip", , "leip@pik-potsdam.de", role = c("aut", "cre")),
person("Edna", "Molina Bacca", role = "aut"))
Expand All @@ -16,7 +16,8 @@ Depends:
madrat (>= 3.10.0),
mrdrivers (>= 1.0.0),
mstools (>= 0.6.0),
mrcommons (>= 1.41.0)
mrcommons (>= 1.41.0),
mrlandcore (>= 1.2.0)
Imports:
dplyr,
magpiesets,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import(madrat)
import(magclass)
import(mrcommons)
import(mrdrivers)
import(mrlandcore)
import(mstools)
importFrom(GDPuc,toolConvertGDP)
importFrom(dplyr,"%>%")
Expand Down
2 changes: 1 addition & 1 deletion R/calcPricesProducer.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ calcPricesProducer <- function(products = "kcr", calculation = "VoP", weighting

# weight: Production
if (weighting == "production") {
mappingFAO <- toolGetMapping("FAO2LUH2MAG_croptypes.csv", type = "sectoral", where = "mrcommons")
mappingFAO <- toolGetMapping("FAO2LUH2MAG_croptypes.csv", type = "sectoral", where = "mrlandcore")
itemsIntersect <- intersect(getNames(pricesProdFAO), unique(mappingFAO$ProductionItem))
weightProd <- collapseNames(readSource("FAO_online", "Crop")[, , "production"])
getNames(weightProd)[getNames(weightProd) == "254|Oil palm fruit"] <- "254|Oil, palm fruit"
Expand Down
2 changes: 1 addition & 1 deletion R/calcVoPcrops.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ calcVoPcrops <- function(fillGaps = TRUE, unit = "constant 2017 US$MER") {
getNames(vopAll)[getNames(vopAll) == "254|Oil palm fruit"] <- "254|Oil, palm fruit"

# items for aggregation
mappingFAO <- toolGetMapping("FAO2LUH2MAG_croptypes.csv", type = "sectoral", where = "mrcommons")
mappingFAO <- toolGetMapping("FAO2LUH2MAG_croptypes.csv", type = "sectoral", where = "mrlandcore")
itemsIntersect <- intersect(getNames(vopAll), unique(mappingFAO$ProductionItem))
mappingFAO <- mappingFAO[mappingFAO$ProductionItem %in% itemsIntersect, ]

Expand Down
2 changes: 1 addition & 1 deletion R/imports.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by lucode2: do not edit by hand

#' @import GDPuc magclass madrat mrdrivers mstools mrcommons
#' @import GDPuc magclass madrat mrdrivers mstools mrcommons mrlandcore
NULL
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MADRaT based package on factor inputs

R package **mrfactors**, version **0.5.5**
R package **mrfactors**, version **0.6.0**

[![CRAN status](https://www.r-pkg.org/badges/version/mrfactors)](https://cran.r-project.org/package=mrfactors) [![R build status](https://github.com/pik-piam/mrfactors/workflows/check/badge.svg)](https://github.com/pik-piam/mrfactors/actions) [![codecov](https://codecov.io/gh/pik-piam/mrfactors/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrfactors) [![r-universe](https://pik-piam.r-universe.dev/badges/mrfactors)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -38,7 +38,7 @@ In case of questions / problems please contact Debbora Leip <leip@pik-potsdam.de

To cite package **mrfactors** in publications use:

Leip D, Molina Bacca E (2024). _mrfactors: MADRaT based package on factor inputs_. R package version 0.5.5, <URL: https://github.com/pik-piam/mrfactors>.
Leip D, Molina Bacca E (2024). _mrfactors: MADRaT based package on factor inputs_. R package version 0.6.0, <https://github.com/pik-piam/mrfactors>.

A BibTeX entry for LaTeX users is

Expand All @@ -47,7 +47,7 @@ A BibTeX entry for LaTeX users is
title = {mrfactors: MADRaT based package on factor inputs},
author = {Debbora Leip and Edna {Molina Bacca}},
year = {2024},
note = {R package version 0.5.5},
note = {R package version 0.6.0},
url = {https://github.com/pik-piam/mrfactors},
}
```

0 comments on commit 21dcf45

Please sign in to comment.