tests/testthat/test-datacube.R

dont_test <- function() {

  iris_dc <- as.datacube ( x = iris[1:6,],
                           obs_id = NULL,
                           dimension_names = NULL,
                           measure_names = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"),
                           attribute_names = "Species")

  test_that("as.datacube", {
    expect_equal(attributes(iris_dc)$observations, "obs_id")
    expect_equal(length(attributes(iris_dc)$dimensions), 0)
    expect_equal(attributes(iris_dc)$attributes, "Species")
    expect_equal(attributes(iris_dc)$measures, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"))
  })

}

Try the dataset package in your browser

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

dataset documentation built on March 31, 2023, 10:24 p.m.