This function takes the model object and the list save_opt and stores the specified outputs to files. The model object is stored to an .rds file, model summary created using summarize is stored to a .txt file using sink(), and hessian and variance-covariance matrices are stored as .csv files. Appropriate checks should be in place to avoid over-writing existing files and to close open sink connections. However, it is on the user to be careful with file names to avoid any chance of loosing data.

save(x, path = getwd(), what = "object", ...)

Arguments

x

A 'cmdlr' model object

path

The file path to the folder where the output should be saved. The default is the current working directory. The file name is inferred based on the model name and the 'what' argument.

what

What output to save. One of: 'object', 'summary', 'hessian', 'vcov'. The default is the model object.

...

Additional parameters passed to the function. For example, 'robust' if you are saving the variance-covariance matrix