Skip to contents

This function allows you to write R data frames given in the `object` argument to excel files located in the `path` directory. The function takes several arguments but the only two required are `object` and `path`.
See examples gallery : <https://ddotta.github.io/tablexlsx/articles/aa-examples.html>

Usage

toxlsx(
  object,
  tosheet = list(),
  title = list(),
  columnstyle = list(default = NULL),
  footnote1 = list(),
  footnote2 = list(),
  footnote3 = list(),
  mergecol = NULL,
  path,
  filename = "Export",
  automaticopen = FALSE
)

Arguments

object

data.frame to be converted to excel

tosheet

list of sheet names for each element of object. If omitted, sheets are named by default "Sheet 1", "Sheet 2"...

title

list of title for each element of object If omitted, title takes the name of the dataframe in `object`

columnstyle

list of style for columns of each element of object Only useful if you want to customise the style of each column `

footnote1

list of footnote1 for each element of object If omitted, no footnote1

footnote2

list of footnote2 for each element of object If omitted, no footnote2

footnote3

list of footnote3 for each element of object If omitted, no footnote3

mergecol

character vector that indicates the columns for which we want to merge the modalities

path

path to save excel file

filename

name for the excel file ("Export" by default)

automaticopen

logical indicating if excel file should open automatically (FALSE by default)

Value

an excel file

Examples

# Simply export a data frame to an xlsx file
# For more examples, see examples gallery :
# https://ddotta.github.io/tablexlsx/articles/aa-examples.html
toxlsx(object = iris, path = tempdir())
#>  Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpNaq9tO'