Skip to content

Commit

Permalink
fix weights
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rst3ns committed Apr 8, 2024
1 parent aacbdfb commit 2530b69
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '4360620'
ValidationKey: '4380441'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
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: 'mrsoil: MadRat Soil Organic Carbon Budget Library'
version: 2.2.0
version: 2.2.1
date-released: '2024-04-08'
abstract: This packages provides functions for soil organic carbon budget for mineral
soils using the steady-state method (Tier 2) of the 2019 Refinement to the 2006
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mrsoil
Type: Package
Title: MadRat Soil Organic Carbon Budget Library
Version: 2.2.0
Version: 2.2.1
Date: 2024-04-08
Authors@R: c(person("Kristine", "Karstens", email = "karstens@pik-potsdam.de", role = c("aut","cre")),
person("Jan Philipp", "Dietrich", email = "dietrich@pik-potsdam.de", role = "aut"))
Expand Down
10 changes: 5 additions & 5 deletions R/calcCarbonInputMultiplier.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ calcCarbonInputMultiplier <- function(inputType = "kcr") {

# get weights
if (inputType %in% c("kcr", "generic")) {

weight <- collapseNames(calcOutput("ResBiomass", cellular = TRUE, aggregate = FALSE)[, "y1995", "c"])
weight <- ifelse(inputType == "kcr",
dimSums(weight, dim = 3.1), # for kcr
setNames(dimSums(weight, dim = 3), "generic")) # for 'generic'
if (inputType == "kcr") {
weight <- dimSums(weight, dim = 3.1) # for kcr
} else {
weight <- setNames(dimSums(weight, dim = 3), "generic") # for 'generic'
}
} else if (inputType == "kli") {

weight <- collapseNames(calcOutput("CarbonManure", aggregate = FALSE)[, "y1995", "c"])
} else {
stop("inputType setting unknown.")
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MadRat Soil Organic Carbon Budget Library

R package **mrsoil**, version **2.2.0**
R package **mrsoil**, version **2.2.1**

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

Expand Down Expand Up @@ -38,7 +38,7 @@ In case of questions / problems please contact Kristine Karstens <karstens@pik-p

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

Karstens K, Dietrich J (2024). _mrsoil: MadRat Soil Organic Carbon Budget Library_. doi:10.5281/zenodo.4317933 <https://doi.org/10.5281/zenodo.4317933>, R package version 2.2.0, <https://github.com/pik-piam/mrsoil>.
Karstens K, Dietrich J (2024). _mrsoil: MadRat Soil Organic Carbon Budget Library_. doi:10.5281/zenodo.4317933 <https://doi.org/10.5281/zenodo.4317933>, R package version 2.2.1, <https://github.com/pik-piam/mrsoil>.

A BibTeX entry for LaTeX users is

Expand All @@ -47,7 +47,7 @@ A BibTeX entry for LaTeX users is
title = {mrsoil: MadRat Soil Organic Carbon Budget Library},
author = {Kristine Karstens and Jan Philipp Dietrich},
year = {2024},
note = {R package version 2.2.0},
note = {R package version 2.2.1},
doi = {10.5281/zenodo.4317933},
url = {https://github.com/pik-piam/mrsoil},
}
Expand Down

0 comments on commit 2530b69

Please sign in to comment.