tests/testthat/test-v3_0_0_bugs.R

context("v3.0.0 Bug Fixes")



test_that("read.xlsx bug fixes", {
  file <- system.file("extdata", "readTest.xlsx", package = "openxlsx")
  df <- read.xlsx(file, sheet = 1, rows = 1:2, cols = 1)
  expect_equal(df, data.frame("Var1" = TRUE))

  df <- read.xlsx(file, sheet = 1, rows = 1, cols = 1, colNames = FALSE)
  expect_equal(df, data.frame("X1" = "Var1", stringsAsFactors = FALSE))
})

Try the openxlsx package in your browser

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

openxlsx documentation built on Feb. 16, 2023, 6:47 p.m.