diff --git a/tests/testthat/test-estimate_density.R b/tests/testthat/test-estimate_density.R index d489c0348..51f2b6615 100644 --- a/tests/testthat/test-estimate_density.R +++ b/tests/testthat/test-estimate_density.R @@ -17,20 +17,20 @@ test_that("estimate_density", { expect_equal(mean(density_kernel$y - density_mixture$y), 0, tolerance = 0.1) x <- iris - x$Fac <- rep(c("A", "B"), length.out = 150) + x$Fac <- rep_len(c("A", "B"), 150) rez <- estimate_density(x, select = "Sepal.Length") - expect_equal(dim(rez), c(1024, 3)) + expect_identical(dim(rez), c(1024L, 3L)) rez <- estimate_density(x, select = c("Sepal.Length", "Petal.Length")) - expect_equal(dim(rez), c(2048, 3)) + expect_identical(dim(rez), c(2048L, 3L)) - rez <- estimate_density(x, select = "Sepal.Length", at = "Species") - expect_equal(dim(rez), c(1024 * 3, 4)) + rez <- estimate_density(x, select = "Sepal.Length", by = "Species") + expect_identical(dim(rez), as.integer(c(1024 * 3, 4))) - rez <- estimate_density(x, select = c("Sepal.Length", "Petal.Length"), at = "Species") - expect_equal(dim(rez), c(2048 * 3, 4)) + rez <- estimate_density(x, select = c("Sepal.Length", "Petal.Length"), by = "Species") + expect_identical(dim(rez), as.integer(c(2048 * 3, 4))) - rez <- estimate_density(x, select = "Sepal.Length", at = c("Species", "Fac"), method = "KernSmooth") - expect_equal(dim(rez), c(1024 * 3 * 2, 5)) + rez <- estimate_density(x, select = "Sepal.Length", by = c("Species", "Fac"), method = "KernSmooth") + expect_identical(dim(rez), as.integer(c(1024 * 3 * 2, 5))) })