tests/testthat/test-addPicture.R

context('addPicture')

test_that('works with basic image', {

  f <- test_ref('log_plot.jpeg')
  wb <- createWorkbook()
  sheet <- createSheet(wb, "Image")
  
  pic <- addPicture(file=f, sheet)
  saveWorkbook(wb, file=test_tmp("addPicture.xlsx"))
  
  expect_true(.jinstanceof(pic,'org/apache/poi/xssf/usermodel/XSSFPicture'))
})

Try the xlsx package in your browser

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

xlsx documentation built on Nov. 10, 2020, 3:52 p.m.