export_sums function in R - export to Microsoft file error

Viewed 15

I've managed to get the export_sums function to work, to generate me a nice table of the logistic regression outputs I require.

The function has an option to be able to export the output into a Word, Excel or PDF etc format but I can't get the last two lines of the code to work.

This function is in the jtools package.

https://cran.r-project.org/web/packages/jtools/jtools.pdf https://www.rdocumentation.org/packages/jtools/versions/2.2.0/topics/export_summs

export_summs(modelRQ1.3,
         error_format = "[{conf.low}, {conf.high}] & p = {p.value})",
         exp = TRUE,
         vifs = TRUE,
         ci_level= 0.95,
         statistics = NULL,
         model.names = NULL,
         coefs = NULL,
         to.file = "xlsx",
         file.name = "testingodds.xlsx")

The error message is:

Error in `stop_wrap()`:
! You need the 'flextable' package to write to Microsoft Word or Excel.
Backtrace:
 1. jtools::export_summs(...)

So I then installed the package it suggested, ran the code again, and got the same error message but saying I need to install another package. And so on.

A colleague suggested I install it using this command:

install.packages("jtools", dependencies = c("Depends", "Imports"), INSTALL_opts = '--no-lock')

But I'm getting the same error message.

0 Answers
Related