tests/testthat/test-plot.n_factors.R

test_that("`plot.see_n_factors()` works", {
  skip_if_not_installed("nFactors")

  result <- parameters::n_factors(datasets::mtcars, type = "PCA")

  set.seed(123)
  vdiffr::expect_doppelganger(
    title = "bar graph",
    fig = plot(result)
  )

  set.seed(123)
  vdiffr::expect_doppelganger(
    title = "line graph",
    fig = plot(result, type = "line")
  )
})

Try the see package in your browser

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

see documentation built on Nov. 3, 2023, 5:10 p.m.