## Create a new workbook
wb <- wb_workbook("Ayanami")
## Add some worksheets
wb$add_worksheet("Sheet 1")
wb$add_worksheet("Sheet 2")
wb$add_worksheet("Sheet 3")
## Insert images
img <- system.file("extdata", "einstein.jpg", package = "openxlsx2")
wb$add_image("Sheet 1", img, startRow = 5, startCol = 3, width = 6, height = 5)
wb$add_image(2, img, startRow = 2, startCol = 2)
wb$add_image(3, img, width = 15, height = 12, startRow = 3, startCol = "G", units = "cm")
Run the code above in your browser using DataLab