Baseline subtraction from a vector, usually representing an IRF.
baseIRF(irfvec, indexlow, indexhigh, removeNeg = FALSE)
irfvec
: Vector to subtract a baseline fromindexlow
: Lowest index to base the baseline estimation onindexhigh
: Highest index to base the baseline estimation onremoveNeg
: Whether negative values should be replaced with 0.Currently estimates the baseline as the mean of data between indexlow and indexhigh, and subtracts the result from the entire vector.
vector
Katharine M. Mullen, Ivo H. M. van Stokkum
irfvec <- rnorm(128, mean=1) plot(irfvec,type="l") irfvec_corrected <- baseIRF(irfvec, 1, 10) lines(irfvec_corrected, col=2)