tests/testthat/test-matrices.R

context("spark.matrix")

test_that("common scale", {
  M <- rbind(1:10, 2*1:10)
  s <- spark(M)
  s2 <- substring(spark(1:20), 1, 10)
  expect_equal(s[1], s2[1])
})

test_that("different scales", {
  M <- rbind(1:10, 2*1:10)
  s <- spark(M, common_scale = FALSE)
  expect_equal(s[1], s[2])
})

Try the spark package in your browser

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

spark documentation built on July 21, 2017, 1:02 a.m.