tests/testthat/test-create_profiles_mplus.R

context("test-create_profiles_mplus-r.R")

test_that("estimate_solutions_mplus() works", {
  skip_on_cran()
  skip_on_travis()
  x <- estimate_profiles_mplus(iris, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, model = 1, n_profiles = 3)
  y <- dplyr::count(x, C)
  expect_equal(dplyr::pull(y)[1], 50)
  expect_equal(dplyr::pull(y)[2], 55)
  expect_equal(dplyr::pull(y)[3], 45)

  # y <- as.data.frame(suppressWarnings(x$parameters$unstandardized[x$parameters$unstandardized$paramHeader == "Means", ]))
  #
  # expect_equal(y[1, 3], 5.01, tolerance = .01)
  # expect_equal(y[5, 3], 5.92, tolerance = .01)
  # expect_equal(y[9, 3], 6.68, tolerance = .01)
  #
  # expect_equal(y[2, 3], 3.43, tolerance = .01)
  # expect_equal(y[6, 3], 2.75, tolerance = .01)
  # expect_equal(y[10, 3], 3.02, tolerance = .01)
  #
  # expect_equal(y[3, 3], 1.46, tolerance = .01)
  # expect_equal(y[7, 3], 4.32, tolerance = .01)
  # expect_equal(y[11, 3], 5.62, tolerance = .01)
  #
  # expect_equal(y[4, 3], 0.24, tolerance = .01)
  # expect_equal(y[8, 3], 1.35, tolerance = .01)
  # expect_equal(y[12, 3], 2.07, tolerance = .01)
})
jrosen48/tidyLPA documentation built on Aug. 18, 2018, 5:34 a.m.