tests/testthat/test_plot_dirichletprocess.R

context("Specific Dirichlet process plotting tests")

test_that("Univariate Plotting", {

  dp <- DirichletProcessGaussian(rnorm(10))
  dp <- Fit(dp, 10)

  testPlot <- plot_dirichletprocess_univariate(dp)

  expect_is(testPlot, c("gg", "ggplot"))

})

test_that("Multivariate Plotting", {

  testData <- matrix(c(rnorm(10), rnorm(10, 5)), ncol=2)

  dp <- DirichletProcessMvnormal(testData)
  dp <- Fit(dp, 10)

  testPlot <- plot_dirichletprocess_multivariate(dp)

  expect_is(testPlot, c("gg", "ggplot"))

})

Try the dirichletprocess package in your browser

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

dirichletprocess documentation built on Aug. 25, 2023, 5:19 p.m.