tests/testthat/test-topsa.R

test_that("barcode_plotter works", {
  linear.fun <- function(X) {
    -2 * X[, 1] +  X[, 2]
  }

  X <- data.frame(
    X1 = runif(20, -1, 1),
    X2 = runif(20, -1, 1),
    X3 = runif(20, -1, 1)
  )
  Y <- data.frame(linear.fun(X))

  p <- topsa(
    Ydat = Y,
    Xdat = X,
    threshold.radius =  c(0.5, 0.5, 0.5)
  )

  expect_s3_class(p, "topsa")
})

Try the topsa package in your browser

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

topsa documentation built on Oct. 23, 2020, 7:13 p.m.