From 4131c28dccf82e67fc191edb2bf707fff78768d7 Mon Sep 17 00:00:00 2001 From: Taha Ahmed Date: Mon, 21 Feb 2011 11:13:13 +0100 Subject: [PATCH] cv2df() now includes cycles as well as segments in the returned df. --- CHI.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHI.R b/CHI.R index e8ad0cd..0e036f3 100644 --- a/CHI.R +++ b/CHI.R @@ -349,12 +349,12 @@ cv2df <- function(cvfilename) { for (s in 1:length(starts)) { zz <- textConnection(chifile[starts[s]:ends[s]], "r") ff <- rbind(ff, - data.frame(segment = factor(s), + data.frame(segment = factor(s), cycle = ceiling(factor(s)/2), matrix(scan(zz, what = numeric(), sep = ","), ncol = 3, byrow = T))) close(zz) } - names(ff) <- c("segment", "potential", "current", "charge") + names(ff) <- c("segment", "cycle", "potential", "current", "charge") # ### Collect attributes of this experiment # These attributes are specific for each kind of experiment,