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: '57667642'
ValidationKey: '57688304'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'magpie4: MAgPIE outputs R package for MAgPIE version 4.x'
version: 2.79.1
version: 2.79.2
date-released: '2026-07-28'
abstract: Common output routines for extracting results from the MAgPIE framework
(versions 4.x).
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: magpie4
Title: MAgPIE outputs R package for MAgPIE version 4.x
Version: 2.79.1
Version: 2.79.2
Date: 2026-07-28
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = c("aut", "cre")),
Expand Down
16 changes: 4 additions & 12 deletions R/reportFeedConversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,11 @@ reportFeedConversion <- function(gdx, livestockSystem = TRUE, balanceflow = FALS
livestockProdReg <- production(gdx, products = "kli", attributes = "dm", level = "reg")
livestockProd <- superAggregateX(livestockProdReg, aggr_type = "sum", level = level)
livestockYield <- livestockYield[, getYears(livestockProd), ]
# Any level beyond 'reg' has to be aggregated here. Note that the aggregated
# rows are sum(yield * production) rather than a production-weighted mean;
# this reproduces the behaviour of the removed colSums() call and is kept
# deliberately.
# A yield is an intensive quantity, so it aggregates as the production-weighted
# mean of the regional yields, not as their sum.
livestockProdReg <- livestockProdReg[getItems(livestockYield, 1.1), , ]
if (level == "regglo") {
livestockYield <- mbind(livestockYield,
superAggregateX(livestockYield * livestockProdReg,
aggr_type = "sum", level = "glo"))
} else if (level != "reg") {
livestockYield <- superAggregateX(livestockYield * livestockProdReg,
aggr_type = "sum", level = level)
}
livestockYield <- superAggregateX(livestockYield, aggr_type = "weighted_mean",
weight = livestockProdReg, level = level)
prefix <- "Productivity|Livestock system yield|"
nameIndicator <- paste0(prefix, getNames(livestockYield, dim = 1), " (", "DM per live animal", ")")
x <- mbind(x, setNames(livestockYield, nameIndicator))
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAgPIE outputs R package for MAgPIE version 4.x

R package **magpie4**, version **2.79.1**
R package **magpie4**, version **2.79.2**

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158582.svg)](https://doi.org/10.5281/zenodo.1158582) [![R build status](https://github.com/pik-piam/magpie4/workflows/check/badge.svg)](https://github.com/pik-piam/magpie4/actions) [![codecov](https://codecov.io/gh/pik-piam/magpie4/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/magpie4) [![r-universe](https://pik-piam.r-universe.dev/badges/magpie4)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Benjamin Leon Bodirsky <bodirsky@

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

Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M, Sauer P, Bonsch M, Vartika S, Rein P (2026). "magpie4: MAgPIE outputs R package for MAgPIE version 4.x." doi:10.5281/zenodo.1158582 <https://doi.org/10.5281/zenodo.1158582>, Version: 2.79.1, <https://github.com/pik-piam/magpie4>.
Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M, Sauer P, Bonsch M, Vartika S, Rein P (2026). "magpie4: MAgPIE outputs R package for MAgPIE version 4.x." doi:10.5281/zenodo.1158582 <https://doi.org/10.5281/zenodo.1158582>, Version: 2.79.2, <https://github.com/pik-piam/magpie4>.

A BibTeX entry for LaTeX users is

Expand All @@ -51,6 +51,6 @@ A BibTeX entry for LaTeX users is
date = {2026-07-28},
year = {2026},
url = {https://github.com/pik-piam/magpie4},
note = {Version: 2.79.1},
note = {Version: 2.79.2},
}
```
Loading