dcomtois / summarytools

R Package to Quickly and Neatly Summarize Data
522 stars 78 forks source link

dfSummary graphs not rendering correctly in Rmarkdown #69

Closed shannonpileggi closed 5 years ago

shannonpileggi commented 5 years ago

Hi - I have successfully used dfSummary in R markdown for the previous version of summarytools, but when I updated I encountered incorrect results. I tried to follow this vignette, and the graphs are no longer rendering correctly. I am using:

OS: Windows 10 R: version 3.5.3 (2019-03-11) RStudio: Version 1.2.1335 summarytools: version 0.9.3

I get this output with the Rmarkdown code below. Let me know if you have any ideas on how to correct it! Thank you.

image


title: "dfSummary test" output: html_document

library(knitr)
library(summarytools)
opts_chunk$set(comment=NA, prompt=FALSE, cache=FALSE, echo=TRUE, results='asis')
st_options(bootstrap.css     = FALSE,       # Already part of the theme so no need for it
           plain.ascii       = FALSE,       # One of the essential settings
           style             = "rmarkdown", # Idem.
           dfSummary.silent  = TRUE,        # Suppresses messages about temporary files
           footnote          = NA,          # Keeping the results minimalistic
           subtitle.emphasis = FALSE)       # For the vignette theme, this gives
                                            # much better results. Your mileage may vary.
st_css()
dfSummary(tobacco, style = 'grid', graph.magnif = 0.75, tmp.img.dir = "/tmp")
dcomtois commented 5 years ago

Hi, could you pls try with the dev version?

devtools::install_github("dcomtois/summarytools", ref="dev-current")

Thanks

shannonpileggi commented 5 years ago

Still getting the same result.

dcomtois commented 5 years ago

Ok. Could you check the /tmp directory and see if it's got 9999 png's in it? In any case, emptying it would be the next thing to try. Thx.

shannonpileggi commented 5 years ago

When using tmp.img.dir = "/tmp" is this supposed to create a tmp subfolder in your current working directory/project, or somewhere else?

shannonpileggi commented 5 years ago

I am still trying to resolve this issue, your input would be much appreciated! Thank you.

dcomtois commented 5 years ago

Hi, so sorry about the delay, I thought I had answered to your question, my mistake! When you use "/tmp", it will create a tmp directory at the root of your hard drive. To create it in your working directory, simply use "tmp".

dcomtois commented 5 years ago

Closing for now, if you still have issues I'll reopen.