Potentials vs SHE now converted to SHE.

Previous behaviour returned NAs for values that were already vs SHE. That issue now fixed. The fix included added SHE (zero at all temperatures) to as.SHE.data.
master
Taha Ahmed 8 years ago
parent 82f635f3a3
commit b1bed60d40

@ -1,7 +1,7 @@
Package: common Package: common
Type: Package Type: Package
Title: chepec common Title: chepec common
Version: 0.0.0.9002 Version: 0.0.0.9003
Description: Commonly used functions and scripts. Description: Commonly used functions and scripts.
Authors@R: person("Taha", "Ahmed", email = "taha@chepec.se", role = c("aut", "cre")) Authors@R: person("Taha", "Ahmed", email = "taha@chepec.se", role = c("aut", "cre"))
License: GPL-3 License: GPL-3

@ -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", "30", "0.241", "6", "Sawyer1995",
"Hg2Cl2/Hg", "KCl(aq)", "4.2", "saturated", "35", "0.238", "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", "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, ncol = 8,
byrow = TRUE), stringsAsFactors = FALSE) byrow = TRUE), stringsAsFactors = FALSE)
@ -283,6 +287,12 @@ as.SHE <- function(potential,
# add column to hold calc potential vs SHE # add column to hold calc potential vs SHE
df$SHE <- as.numeric(NA) 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 # AVS scale special considerations
# 1. concentration is meaningless # 1. concentration is meaningless
# 2. direction is opposite of electrochemical scales, requiring change of sign # 2. direction is opposite of electrochemical scales, requiring change of sign

Loading…
Cancel
Save