1

I have a dataset consist of factors and numeric and I want to export view(dfSummary(mtcars)) in my latex is it possible? many thanks in advance

library(summarytools)
data("mtcars")
view(dfSummary(mtcars))

this is not working xtable(dfSummary(mtcars))

Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61
Seyma Kalay
  • 2,037
  • 10
  • 22
  • 2
    See https://github.com/dcomtois/summarytools, section 6 about the PDF issue. Seems like you would have to go through conversion of the html file (e.g. with wkhtmltopdf) and import into LaTeX. – user12728748 Apr 13 '20 at 17:11
  • That's right @user12728748. For now this is the best approach for creating pdfs. – Dominic Comtois Jun 04 '20 at 16:54

1 Answers1

1

In RStudio, if you create an Rmarkdown document, with pdf as output format, you can go in Output Options > Advanced > Keep tex source file used to produce PDF.

RStudio-Markdown-Document-Options

When using png images (with style="grid" and specified tmp.img.dir), there is an alignment issue; you need to add this to the \includegraphics commands: \includegraphics[valign=t]. You can also use something like \raisebox{0.5\height} if the image appears too low in its table cell.

Dominic Comtois
  • 10,230
  • 1
  • 39
  • 61