toSheet: Send something to a sheet

Description Usage Arguments Value Methods (by class) Examples

Description

toSheet sends tabular data or an image to a new xlsx work sheet.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
toSheet(x, workbook, sheetName, ...)

## S3 method for class 'data.frame'
toSheet(d, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), auto.filter = TRUE,
  freeze.pane = TRUE, row.names = FALSE, startRow = 1, ...)

## S3 method for class 'tbl_df'
toSheet(d, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), ...)

## S3 method for class 'tbl'
toSheet(d, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), ...)

## S3 method for class 'matrix'
toSheet(d, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), row.names = TRUE, ...)

## S3 method for class 'character'
toSheet(x, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), landscape = TRUE)

## S3 method for class 'ggplot'
toSheet(p, workbook = getWorkbook(),
  sheetName = getSheetName(workbook), filename = tempfile(fileext =
  ".jpeg"), landscape = TRUE, height = if (landscape) 7 else 9.7,
  width = if (landscape) 8.5 else 5.99, ...)

Arguments

x

A data frame, plot or path to a saved plot.

workbook

An optional xlsx work book.

sheetName

Character, an optional title for the new sheet.

...

Other parameters to pass to addDataFrame.

auto.filter

A boolean, should the columns be filtered.

freeze.pane

A boolean, should the top row be frozen.

row.names

A boolean, should therow names of x be written along with x to the file.

startRow

A scalar integer, the row to start the data frame.

landscape

A boolean, should the sheet be oriented horizontally.

filename

Optional file path and name for the temporary file for the image of the plot.

height

Numeric, optional height of the image in inches.

width

Numeric, optional width of the image in inches.

Value

A worksheet object, invisibly.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
book <- createWorkbook()
toSheet(mtcars, book, "mtcars")

library(ggplot2)
p <- ggplot(mtcars, aes(mpg))
p <- p + geom_bar()
toSheet(p)

## End(Not run)

But-I-Digress/xlsxSimple documentation built on Jan. 26, 2020, 9:53 a.m.