Learn R Programming

cSEM (version 0.5.0)

exportToExcel: Export to Excel (.xlsx)

Description

lifecycle::badge("experimental")

Usage

exportToExcel(
  .postestimation_object = NULL, 
  .filename              = "results.xlsx",
  .path                  = NULL
  )

Arguments

.postestimation_object

An object resulting from a call to one of cSEM's postestimation functions (e.g. summarize()).

.filename

Character string. The file name. Defaults to "results.xlsx".

.path

Character string. Path of the directory to save the file to. Defaults to the current working directory.

Details

Export results from postestimation functions assess(), predict(), summarize() and testOMF() to an .xlsx (Excel) file. The function uses the openxlsx package which does not depend on Java!

The function is deliberately kept simple: all it does is to take all the relevant elements in .postestimation_object and write them (worksheet by worksheet) into an .xlsx file named .filename in the directory given by .path (the current working directory by default).

If .postestimation_object has class attribute _2ndorder two .xlsx files named ".filename_first_stage.xlsx" and ".filename_second_stage.xlsx" are created. If .postestimation_object is a list of appropriate objects, one file for each list elements is created.

Note: rerunning exportToExcel() without changing .filename and .path overwrites the file!

See Also

assess(), summarize(), predict(), testOMF()