img <- system.file("extdata", "einstein.jpg", package = "openxlsx2")
wb <- wb_workbook()$
add_worksheet()$
add_image("Sheet 1", dims = "C5", file = img, width = 6, height = 5)$
add_worksheet()$
add_image(dims = "B2", file = img)$
add_worksheet()$
add_image(dims = "G3", file = img, width = 15, height = 12, units = "cm")
Run the code above in your browser using DataLab