dataExplorer :: create_report无法编译

问题描述 投票:1回答:1

我正在尝试使用DataExplorer包生成名为“mydata”的数据帧的pdf报告。不过我得到以下错误:无法编译D:/ Documents / R / R projects / ENDO / report.tex。

我试图看看tinytex是否发生任何错误:

options(tinytex.verbose = TRUE)
devtools::install_github('yihui/tinytex')

但没有检测到错误。

这是我使用的初始代码:

options(tinytex.verbose = TRUE)
DataExplorer::create_report(mydata, output_format = "pdf_document")

这是输出:

processing file: report.rmd
  |..                                                               |   2%
  ordinary text without R code

  |...                                                              |   5%
label: global_options (with options) 
List of 1
 $ include: logi FALSE

  |.....                                                            |   7%
  ordinary text without R code

  |......                                                           |  10%
label: introduce
  |........                                                         |  12%
  ordinary text without R code

  |.........                                                        |  14%
label: plot_intro
  |...........                                                      |  17%
  ordinary text without R code

  |............                                                     |  19%
label: data_structure
  |..............                                                   |  21%
  ordinary text without R code

  |...............                                                  |  24%
label: missing_profile
  |.................                                                |  26%
  ordinary text without R code

  |...................                                              |  29%
label: univariate_distribution_header
  |....................                                             |  31%
  ordinary text without R code

  |......................                                           |  33%
label: plot_histogram
  |.......................                                          |  36%
  ordinary text without R code

  |.........................                                        |  38%
label: plot_density
  |..........................                                       |  40%
  ordinary text without R code

  |............................                                     |  43%
label: plot_frequency_bar
  |.............................                                    |  45%
  ordinary text without R code

  |...............................                                  |  48%
label: plot_response_bar
  |................................                                 |  50%
  ordinary text without R code

  |..................................                               |  52%
label: plot_with_bar
  |....................................                             |  55%
  ordinary text without R code

  |.....................................                            |  57%
label: plot_normal_qq
  |.......................................                          |  60%
  ordinary text without R code

  |........................................                         |  62%
label: plot_response_qq
  |..........................................                       |  64%
  ordinary text without R code

  |...........................................                      |  67%
label: plot_by_qq
  |.............................................                    |  69%
  ordinary text without R code

  |..............................................                   |  71%
label: correlation_analysis
  |................................................                 |  74%
  ordinary text without R code

  |..................................................               |  76%
label: principle_component_analysis
  |...................................................              |  79%
  ordinary text without R code

  |.....................................................            |  81%
label: bivariate_distribution_header
  |......................................................           |  83%
  ordinary text without R code

  |........................................................         |  86%
label: plot_response_boxplot
  |.........................................................        |  88%
  ordinary text without R code

  |...........................................................      |  90%
label: plot_by_boxplot
  |............................................................     |  93%
  ordinary text without R code

  |..............................................................   |  95%
label: plot_response_scatterplot
  |...............................................................  |  98%
  ordinary text without R code

  |.................................................................| 100%
label: plot_by_scatterplot

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS "D:/Documents/R/R projects/ENDO/report.utf8.md" --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pandoc3a5c401d986.tex --template "C:\PROGRA~1\R\R-35~1.1\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" 

Error: Failed to compile D:/Documents/R/R projects/ENDO/report.tex.

有什么建议?

r pdf data-analysis pdflatex dataexplorer
1个回答
0
投票

[更新于2019/03/19]

使用CRAN(v0.8)上的最新版本,我可以使用以下代码生成PDF报告:

create_report(
  data = iris,
  output_format = pdf_document(),
  output_file = "report.pdf",
  config = configure_report(add_plot_str = FALSE)
)

[过时的答案]

我相信plot_str中的JavaScript代码会导致错误,因为PDF是静态文档。我可以使用以下代码生成PDF报告:

create_report(
    data = iris,
    output_format = "pdf_document",
    output_file = "report.pdf",
    config = list(
        "introduce" = list(),
        "plot_intro" = list(),
        "plot_missing" = list(),
        "plot_histogram" = list(),
        "plot_qq" = list(sampled_rows = 1000L),
        "plot_bar" = list(),
        "plot_correlation" = list("cor_args" = list("use" = "pairwise.complete.obs")),
        "plot_prcomp" = list()
    )
)
© www.soinside.com 2019 - 2024. All rights reserved.