tests/testthat/test_depth_filter.R

context("Testing depth_filterr")

test_that("Removed heave, upcast and soak period", {
  #plot(1:length(x), x)
  x <- c(1.095, 1.094, 1.2, 1.096, 1.098, 1.097, 1.101, 1.12, 1.12, 1.12, 1.151, 1.201, 1.245, 1.293, 1.379,
         1.482, 1.555, 1.616, 1.669, 1.719, 1.78, 1.842, 1.91, 1.949, 1.959,      
         1.955, 1.939, 1.911, 1.899, 1.903, 1.908, 1.922, 1.918, 1.907, 1.893,
         1.88, 1.877, 1.884, 1.895, 1.903, 1.914, 1.917, 1.913, 1.905, 1.9) 
  #plot(1:length(x[depth_filter(x)]),x[depth_filter(x)])
  expect_equal(depth_filter(x), c(1.097, 1.101, 1.12, 1.151, 1.201, 1.245, 1.293, 1.379, 1.482, 
                                    1.555, 1.616, 1.669, 1.719, 1.78, 1.842, 1.91, 1.949, 1.959))

})
boshek/limnotools documentation built on May 13, 2019, 12:36 a.m.