diff --git a/DESCRIPTION b/DESCRIPTION index 887401a..a56c452 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: common Type: Package Title: chepec common -Version: 0.0.0.9002 +Version: 0.0.0.9003 Description: Commonly used functions and scripts. Authors@R: person("Taha", "Ahmed", email = "taha@chepec.se", role = c("aut", "cre")) License: GPL-3 diff --git a/R/unit-converters-electrochemical.R b/R/unit-converters-electrochemical.R index df1240d..d7c456d 100644 --- a/R/unit-converters-electrochemical.R +++ b/R/unit-converters-electrochemical.R @@ -179,7 +179,11 @@ potentials.as.SHE <- function() { "Hg2Cl2/Hg", "KCl(aq)", "4.2", "saturated", "30", "0.241", "6", "Sawyer1995", "Hg2Cl2/Hg", "KCl(aq)", "4.2", "saturated", "35", "0.238", "6", "Sawyer1995", "Hg2Cl2/Hg", "KCl(aq)", "4.2", "saturated", "40", "0.234", "6", "Sawyer1995", - "AVS", "", "", "", "25", "-4.44", "7", "Trasatti1986"), + "AVS", "", "", "", "25", "-4.44", "7", "Trasatti1986", + "SHE", "", "", "", "-273.15", "0.00", "8", "Inzelt2013", + "SHE", "", "", "", "0", "0.00", "8", "Inzelt2013", + "SHE", "", "", "", "25", "0.00", "8", "Inzelt2013", + "SHE", "", "", "", "580", "0.00", "8", "Inzelt2013"), ncol = 8, byrow = TRUE), stringsAsFactors = FALSE) @@ -283,6 +287,12 @@ as.SHE <- function(potential, # add column to hold calc potential vs SHE df$SHE <- as.numeric(NA) + # SHE scale special considerations + # 1. concentration is constant + if (any(df$scale == RefCanonicalName("SHE"))) { + df$concentration[which(df$scale == RefCanonicalName("SHE"))] <- "" + } + # AVS scale special considerations # 1. concentration is meaningless # 2. direction is opposite of electrochemical scales, requiring change of sign