16 lines
423 B
R
Raw Normal View History

2025-01-12 00:52:51 +08:00
library(gridExtra)
library(testthat)
library(grid)
m <- iris[1:4, 1:3]
context("Checking tableGrob layout")
test_that("tableGrob has the correct size", {
expect_that(dim(tableGrob(m)), equals(c(5,4)))
expect_that(dim(tableGrob(m, rows = NULL)), equals(c(5,3)))
expect_that(dim(tableGrob(m, cols = NULL)), equals(c(4,4)))
expect_that(dim(tableGrob(m, rows = NULL, cols = NULL)),
equals(c(4,3)))
})