1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
test_that("layout_manipulate works", {
xy <- cbind(c(0,0,0,0),c(1,2,3,4))
xynew <- layout_mirror(layout_mirror(xy,axis = "horizontal"),axis = "horizontal")
expect_true(all(xynew==xy))
xynew <- layout_mirror(layout_mirror(xy,axis = "vertical"),axis = "vertical")
expect_true(all(xynew==xy))
expect_error(layout_mirror(xy,"diagonal"))
expect_error(layout_mirror(c(1,1),"horizontal"))
expect_equal(layout_rotate(xy,180)[,2],c(-1,-2,-3,-4))
expect_error(layout_rotate(c(1,1),70))
expect_error(layout_rotate(xy,"70"))
})
|