tests/testthat/test-parallel-3d.R

test_that("parpbapply functions work", {
  # Set up
  n <- 1000
  nNodes <- 2
  df <- data.frame(
    x = seq(1, n, 1),
    y = -seq(1, n, 1)
  )
  # Run parallel
  invisible(capture.output(
    s <- parpbsapply(X = df$x, FUN = sum, nNodes = nNodes)
  ))
  invisible(capture.output(
    l <- parpblapply(X = df$x, FUN = sum, nNodes = nNodes)
  ))
  invisible(capture.output(
    a <- parpbapply(X = df, FUN = sum, MARGIN = 1, nNodes = nNodes)
  ))
  # Test
  expect_is(s, "numeric")
  expect_is(l, "list")
  expect_is(a, "numeric")
})

Try the eRTG3D package in your browser

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

eRTG3D documentation built on March 18, 2022, 6:11 p.m.