|
|
@ -3,6 +3,7 @@
|
|
|
|
# Taha Ahmed, Jan 2011
|
|
|
|
# Taha Ahmed, Jan 2011
|
|
|
|
|
|
|
|
|
|
|
|
# CONTENTS
|
|
|
|
# CONTENTS
|
|
|
|
|
|
|
|
# >>>> LinearBaseline
|
|
|
|
# >>>> int2padstr
|
|
|
|
# >>>> int2padstr
|
|
|
|
# >>>> It2charge
|
|
|
|
# >>>> It2charge
|
|
|
|
# >>>> ProvideSampleId
|
|
|
|
# >>>> ProvideSampleId
|
|
|
@ -15,6 +16,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##################################################
|
|
|
|
|
|
|
|
################ LinearBaseline ##################
|
|
|
|
|
|
|
|
##################################################
|
|
|
|
|
|
|
|
LinearBaseline <- function (potential, current, iplim) {
|
|
|
|
|
|
|
|
## Arguments:
|
|
|
|
|
|
|
|
## potential: full half-cycle, potentials
|
|
|
|
|
|
|
|
## current: full half-cycle, currents
|
|
|
|
|
|
|
|
## iplim: interpolation limits along x (potential)
|
|
|
|
|
|
|
|
## Value:
|
|
|
|
|
|
|
|
## A dataframe with two columns, potential and current
|
|
|
|
|
|
|
|
## (of the calculated baseline)
|
|
|
|
|
|
|
|
# Construct potential-current dataframe
|
|
|
|
|
|
|
|
sweep <- data.frame(potential = potential, current = current)
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
sweep.iplim <- subset(subset(sweep, potential > iplim[1]), potential < iplim[2])
|
|
|
|
|
|
|
|
sweep.baseline <- data.frame(potential = approxExtrap(sweep.iplim$potential,
|
|
|
|
|
|
|
|
sweep.iplim$current, xout = sweep$potential, method = "linear")$x,
|
|
|
|
|
|
|
|
current = approxExtrap(sweep.iplim$potential, sweep.iplim$current,
|
|
|
|
|
|
|
|
xout = sweep$potential, method = "linear")$y)
|
|
|
|
|
|
|
|
sweep.data <- data.frame(potential = sweep.baseline$potential,
|
|
|
|
|
|
|
|
current = sweep.baseline$current)
|
|
|
|
|
|
|
|
return(sweep.data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##################################################
|
|
|
|
##################################################
|
|
|
|
################## int2padstr ####################
|
|
|
|
################## int2padstr ####################
|
|
|
|
##################################################
|
|
|
|
##################################################
|
|
|
|