# NOT RUN {
a = rnorm(500) * seq(1, 0, length.out = 500)
b = flatEnv(a, plot = TRUE, killDC = TRUE, method = 'peak',
windowLength_points = 5) # too short
c = flatEnv(a, plot = TRUE, killDC = TRUE,
windowLength_points = 250) # too long
d = flatEnv(a, plot = TRUE, killDC = TRUE,
windowLength_points = 50) # about right
# }
Run the code above in your browser using DataLab