xlsx.addPlot: Adds a plot to a .xlsx file

Description Usage Arguments Examples

View source: R/xlsxboost.R

Description

Makes use of numerous parameters including the sheet, text, start row/column, and width/height in order to display a plot in an excel workbook provided a plot function.

Usage

1
2
xlsx.addPlot(wb, sheet, plotFunction, startRow = NULL, startCol = 2,
  width = 480, height = 480, ...)

Arguments

wb

The excel workbook

sheet

The excel sheet (created by xlsxboost)

plotFunction

The function (i.e. ggplot2(...)) to show in Excel

startRow

The row to start the header on

startCol

The column to start the header on

width

The width of the plot

height

The height of the plot

Examples

1
2
3
4
5
6
7
wb <- createWorkbook(type="xlsx")
sheet <- xlsx::createSheet(wb, sheetName = "example")
x = seq(from = -10*pi, to = 10*pi, by = 0.1)
pf <- function() {plot(sin(x))}
xlsx.addPlot(wb, sheet, pf)
saveWorkbook(wb, "example2.xlsx")
xlsx.openFile("example2.xlsx") # view the file

mananshah99/xlsxboost documentation built on May 21, 2019, 11:23 a.m.