# Different output files in two different environments

My local environment is creating an output HTML file that's different from my testing environment. The settings I use in render are the same, and my output.yaml files are the same as well, so I'm stumped as to what's causing the differences.

The local and testing environments are both on Windows. Testing is on Windows Server, if that makes any important difference. Both are using R 3.6.3, rmarkdown_2.1, dplyr_0.8.5, knitr_1.28. Happy to share any more info on the environment - I'm not sure what else to include.

So the output HTML file in my testing environment includes these two extra lines that I don't see in my local environment's output file:

<script src="data:application/x-javascript;base64,JChkb2N1bWVudCkucmVhZHkoZnVuY3Rpb24oKXsKICAgIGlmICh0eXBlb2YgJCgnW2RhdGEtdG9nZ2xlPSJ0b29sdGlwIl0nKS50b29sdGlwID09PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgJCgnW2RhdGEtdG9nZ2xlPSJ0b29sdGlwIl0nKS50b29sdGlwKCk7CiAgICB9CiAgICBpZiAoJCgnW2RhdGEtdG9nZ2xlPSJwb3BvdmVyIl0nKS5wb3BvdmVyID09PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgJCgnW2RhdGEtdG9nZ2xlPSJwb3BvdmVyIl0nKS5wb3BvdmVyKCk7CiAgICB9Cn0pOwo="></script>



Here is the render function in my R script (same in both local and testing):

report_filename <- file.path('./R', 'render_daily_stats.rmd')
output_dir <- "output"
output <- file.path("..",output_dir)
render(report_filename,
output_yaml = "./R/_output.yaml",
output_dir = output_dir,
params = list(output_dir = output)
)


And here are the contents of the _output.yaml file (same in both local and testing):

---
output:
rmarkdown::html_vignette
---


I'm not sure how the rmarkdown package entirely works, but after reading up on it, I noticed pandoc was a thing. I think these are the outputs. I noticed that they're somehow different in the two environments.
Here's the pandoc command in my local environment:
C:/PROGRA~1/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS render_daily_stats.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output pandoc2a383adb3c91.html --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\username\Documents\R\win-library\3.6\rmarkdown\rmd\h\default.html" --highlight-style pygments --css "C:\Users\username\Documents\R\win-library\3.6\rmarkdown\rmarkdown\templates\html_vignette\resources\vignette.css" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmpw9jJZN\rmarkdown-str2a3827e966b2.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --lua-filter "C:/Users/username/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "C:/Users/username/Documents/R/win-library/3.6/rmarkdown/rmd/lua/latex-div.lua

And here's the pandoc command in my testing environment:
C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS render_daily_stats.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandocb5853f42576.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\team\Documents\R\win-library\3.6\rmarkdown\rmd\h\default.html" --highlight-style pygments --css "C:\Users\team\Documents\R\win-library\3.6\rmarkdown\rmarkdown\templates\html_vignette\resources\vignette.css" --include-in-header "C:\Users\team\AppData\Local\Temp\2\RtmpqSe2em\rmarkdown-strb58dce49f1.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

Would these differences in the pandoc command be causing the differences found in the HTML outputs? If so, how do I get them to be the same or at least remove the extra lines found in the output files? I've played around with the output.yaml files a bunch but to no avail.

Also, I made a Stackoverflow question the other day but without much help so far, so feel free to also answer there for some karma

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.