Ich habe ein Problem beim Generieren eines PDF-Berichts von meiner App glänzend, die auf einem Server gehostet wird.Pandoc Version 1.12.3 oder höher ist erforderlich und wurde nicht gefunden (R glänzend)
die App funktioniert gut, aber wenn ich die Taste drücken, um den Bericht herunterzuladen, erhalte ich diesen Fehler:
pandoc version 1.12.3 or higher is required and was not found.
Die proble ist, dass wenn ich pandoc -v
Typ I erhalten:
pandoc 1.12.3.3
Compiled with texmath 0.6.6, highlighting-kate 0.5.6.1.
Syntax highlighting is supported for the following languages:
actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog,
clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d,
diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang,
fortran, fsharp, gnuassembler, go, haskell, haxe, html, ini, java, javadoc,
javascript, json, jsp, julia, latex, lex, literatecurry, literatehaskell,
lua, makefile, mandoc, markdown, matlab, maxima, metafont, mips, modelines,
modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml,
octave, pascal, perl, php, pike, postscript, prolog, python, r,
relaxngcompact, restructuredtext, rhtml, roff, ruby, rust, scala, scheme,
sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo, verilog, vhdl,
xml, xorg, xslt, xul, yacc, yaml
Default user data directory: /home/daniele/.pandoc
Copyright (C) 2006-2013 John MacFarlane
Web: http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
So Ich nehme an, ich habe die richtige Version dafür. TexLive ist ebenfalls installiert und der Pfad ist in $PATH
.
Server.R
library(shiny)
library(drsmooth)
library(shinyBS)
library(knitr)
library(xtable)
library(rmarkdown)
shinyServer(function(input, output,session) {
output$downloadReport <- downloadHandler(
filename = function() {
paste('report', sep = '.','pdf')
},
content = function(file) {
src <- normalizePath('report.Rmd')
# temporarily switch to the temp dir, in case you do not have write
# permission to the current working directory
owd <- setwd(tempdir())
on.exit(setwd(owd))
file.copy(src, 'report.Rmd')
library(rmarkdown)
out <- render('report.Rmd')
file.rename(out, file)
})
output$tb <- renderUI({
p(h4("Report")),
"Dowload a the report of your analysis in a pdf format",
tags$br(),downloadButton('downloadReport',label="Download report"),
tags$em("This option will be available soon")
})
})
* report.Rmd * enthält keine Art von Berechnung, es ist nur Text. Die PDF-Generierung funktioniert auf meiner lokalen Version (MacOS), aber nicht auf dem Server.
Vielen Dank im Voraus, und ich bin hier, um weitere Informationen zu geben, wenn nötig.
Daniele
Das ist für mich gearbeitet, während Mit dem Befehl 'export' in bash habe ich nicht versucht (sowohl das' pandoc'-Verzeichnis an '$ PATH' anzuhängen als auch das' $ RSTUDIO_PANDOC'). – knowah
Funktioniert das immer noch, wenn RStudio nicht installiert ist? – user5359531
Eine weitere Option ist das Hinzufügen zu einer '.Renviron'-Datei in Ihrem Projekt' RSTUDIO_PANDOC =/usr/lib/rududio/bin/pandoc' Ref: https://csgillespie.github.io/efficientR/3-3 -r-startup.html # renviron – Interfector