tests/testthat/test-position.R

test_that("map.position function works", {
  data(iris)
  df<-subset(iris,select=-Species)
  labels<-subset(iris,select=Species)
  m<-map.build(df,labels,seed=42)
  p<-map.position(m,df)
  # print(p)

  # note: we cannot test for specific values because
  # different random number generators/OSs will generate
  # different behavior.  Here we make sure that at
  # least the returned structure makes sense.

  expect_equal(nrow(p)==nrow(df),TRUE)
  expect_equal(ncol(p), 2)
})

Try the popsom package in your browser

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

popsom documentation built on Dec. 21, 2021, 1:07 a.m.