@ -4,21 +4,21 @@
# CONTENTS
# CONTENTS
source ( " /home/taha/chepec/chetex/common/R/common.R" )
source ( " /home/taha/chepec/chetex/common/R/common.R" )
# >>>> chrono amp2df
# >>>> amp2df
##################################################
##################################################
################# chrono amp2df ###################
################# ### amp2df ### ###################
##################################################
##################################################
chrono amp2df <- function ( datafilename , wearea = 1 ) {
amp2df <- function ( datafilename , wearea = 1 ) {
## Description:
## Description:
## Reads current-time data (from AUTOLAB potentiostat)
## Reads current-time data (from AUTOLAB potentiostat)
## and returns a dataframe with the data and some
## and returns a dataframe with the data and some
## calculated quantities based on the data.
## calculated quantities based on the data.
## Usage:
## Usage:
## chrono amp2df(datafilename, wearea)
## amp2df(datafilename, wearea)
## Arguments:
## Arguments:
## datafilename: text string with full path to experimental file
## datafilename: text string with full path to experimental file
## wearea: (optional) area of working electrode (in square centimeters)
## wearea: (optional) area of working electrode (in square centimeters)
@ -67,6 +67,7 @@ chronoamp2df <- function(datafilename, wearea = 1) {
zz <- textConnection ( chifile [starts [s ] : ends [s ] ] , " r" )
zz <- textConnection ( chifile [starts [s ] : ends [s ] ] , " r" )
ff <- rbind ( ff ,
ff <- rbind ( ff ,
data.frame ( sampleid ,
data.frame ( sampleid ,
stringsAsFactors = FALSE ,
matrix ( scan ( zz , what = numeric ( ) , sep = " " ) ,
matrix ( scan ( zz , what = numeric ( ) , sep = " " ) ,
ncol = 2 , byrow = T ) ) )
ncol = 2 , byrow = T ) ) )
close ( zz )
close ( zz )