tests/testthat/test_depth.filter.R

context("Testing depth_filter")

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
  ))
})

Try the rLakeAnalyzer package in your browser

Any scripts or data that you put into this service are public.

rLakeAnalyzer documentation built on June 10, 2019, 1:02 a.m.