fillimage: fillimage (depreciated)

View source: R/xlsxTools.R

fillimageR Documentation

fillimage (depreciated)

Description

Please note that this function will be depreciated. Use addImage() instead: addImage(onesheet, image, line, col, wide, high, unit, spec.dpi, wb). Insert either an existing image or the current plot into a worksheet.

Usage

fillimage(...)

Arguments

...

Arguments of addImage() function

Value

Nothing

Author(s)

Jenny Howard, Marine Maurel

See Also

addImage()

Examples

## Not run:  
addImage(onesheet = cells, 
          image = graphname, 
          line = 2, 
          col = 2, 
          wb = template) 

## End(Not run)

# Usage 1: Insert existing image saved as a PNG file
xls_file <- externalFile("excelfile.xlsx")
openXlsx(xls_file)
cells <- openSheet("T2")
image_file <- externalFile("image_xlsx.png")
addImage(onesheet = cells, image = image_file, line = 20, col = 2)

# Usage 2: Insert current plot
## Not run: 
image_gg <- ggplot(Orange, 
                   aes(x = age, y = circumference, colour = as.factor(Tree))) +
                   geom_point() + 
                   geom_line() +
                   labs(colour = "Tree") + 
                   theme_minimal()
addImage(onesheet = cells, image = image_gg, line = 20, col = 2)

## End(Not run)
       

Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.