R/n_add_lpinfo.R

Defines functions add_lpinfo make_lp

#' Adding information to a series describing 
#'
#' @param . the series where the lp info should be added to
#' @param conc the concentration of each lp 
#' @param l the length (in sweeps) of each lp
#' @param name the compound name
#'
#' @export

add_lpinfo <- function(., conc, l, name=""){
  .$sweeps$CompoundName=name
  .$sweeps$Concentration=make_lp(c(conc, NA), c(l,ncol(.$sweeps$y)))
}

make_lp<-function(conc, l){
  unlist(lapply(1:length(conc), function(lp) rep(conc, l))  )
}
tdanker/ephys2 documentation built on Aug. 11, 2019, 12:12 p.m.