I'm trying to use the describe() function from the psych package. However, I receive an error when using it after having loaded the Hmisc package, even if specifying psych::describe():
> psych::describe(df)
Error in as.data.frame.default(utils::head(x, maxPrint)): cannot coerce class '"describe"' to a data.frame
I get the error when rendering an rmarkdown (.Rmd) file. I do not get the error when running the underlying R code. I still get the error even after unloading Hmisc. I've isolated the issue to when I am specifying df_print: paged in the YAML settings for html_document.
Note that this is not an issue with
sjPlot
per se, but I was encouraged to open a new issue here with a reproducible example: https://github.com/strengejacke/sjPlot/issues/229I'm trying to use the
describe()
function from thepsych
package. However, I receive an error when using it after having loaded theHmisc
package, even if specifyingpsych::describe()
:I get the error when rendering an
rmarkdown
(.Rmd
) file. I do not get the error when running the underlying R code. I still get the error even after unloadingHmisc
. I've isolated the issue to when I am specifyingdf_print: paged
in theYAML
settings forhtml_document
.Here is a reproducible example with session info etc. (the error occurs in Section 9): https://isaactpetersen.github.io/reprex/
Here is the code (
index.Rmd
):Methods
Load Libraries
Simulate Data
Session Info
Hmisc
is loaded:Methods
Unload
Hmisc
Session Info
Hmisc
is unloaded:Methods
Use
psych::describe()
Throws error:
Session Info
rmarkdown::render("index.Rmd")