formatDataFrame: Extends addDataFrame to output data into formatted Excel...

Description Usage Arguments Details

Description

This function loads an Excel workbook, writes a data frame to the specified tab in the specified location, formats the columns, and then saves the output. Options allow you to load an existing workbook (say to add multiple data frames to different tabs), add freezeframes, autosize columns, and more.

Usage

1
2
3
4
5
formatDataFrame(df, wb = NULL,
  templateFile = paste(path.package("rreporttools"),
  "DSAR Report Template Number 24-Standard and PII - Feb 2014.xlsx", sep = "/"),
  outputFile = "ROutput.xlsx", save = TRUE, sheet = 2, sr = 7, sc = 1,
  styleList, autoSize = TRUE, freezeFrame = TRUE, load = TRUE)

Arguments

df

Data frame to write out

wb

Optional workbook object as returned by formatDataFrame or loadWorkbook

templateFile

Excel template file, default is DSAR's current template

outputFile

Name of file to write out if save = TRUE

save

Logical, save the result to outputFile

sheet

Number of sheet to write output to

sr

Start row of output

sc

Start column of output

styleList

Character vector of format types, see details

autoSize

Logical, autosize columns

freezeFrame

Logical, freezeframe the top row

load

Logical, load the template file before writing output

Details

Possible values for the styleList are "headerStyle", "totalStyle", "textStyle", "moneyStyle", "percStyle", "countStyle", "yearStyle", "dateStyle", and "numberStyle". They should be self-explanatory and they conform with the DSAR template requirements.


sachsmc/rreporttools documentation built on May 29, 2019, 12:55 p.m.