tests/testthat/test-split-data.R

# split data class
test_that('split data',{
  set.seed('57475')
  # DatasetExperiment
  D=iris_DatasetExperiment()
  # method
  M = split_data(p=0.75)
  # apply
  M = model_apply(M,D)
  expect_equal(nrow(M$testing$data),38)
  expect_equal(nrow(M$training$data),112)
})

Try the structToolbox package in your browser

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

structToolbox documentation built on Nov. 8, 2020, 6:54 p.m.