0

I know there are a lot of people have asked this question but I just can't get it resolved, and I'd very much appreciate your expertise! So, I have been using Rmarkdown for couple of years now to generate my reports in a PDF format and have had no issues. Last Friday, my company's antivirus system all of a sudden detected a malicious activity as I was processing my data. After that it automatically deleted R, however the program was recovered after I informed them. Ever since this happened I just can't generate a report anymore. I can have a HTML report but no PDF. I deleted R and Rstudio and reinstalled everything along with the packages but still made no progress. I also tried different things that people suggested such as tinytex::install_tinytex() but that didn't do anything either.

This is the section of my code that is not working (it worked just fine before) :

```{r damage, echo=FALSE, comment=NA , warning= FALSE, out.width="65%" ,fig.show = "hold" , fig.align = "center", fig.cap="Example of a typical damage on the tested optic - Before damage (Top), After Damage (Bottom)"}

path.1 <- "E:\\Cy\\Quality failed parts\\Quality test calibrate"
setwd(path.1)

knitr::include_graphics("E:\\Cy\\Quality failed parts\\Quality test calibrate\\Vert-002-horiz-006-After.jpeg")


```

And this is the error I am getting:

  |.................                                         |  29% (setup)    

processing file: delete.Rmd
                                                                                                      
output file: delete.knit.md

"C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS delete.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output delete.tex --lua-filter "C:\Users\cras\AppData\Local\Programs\R\R-4.2.2\library\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\crash\AppData\Local\Programs\R\R-4.2.2\library\rmarkdown\rmarkdown\lua\latex-div.lua" --embed-resources --standalone --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in" 
! Undefined control sequence.
<argument> E:Cy
                   RasQuality failed partsQuality test calibrateVert -0...
l.75 ...y test calibrate\Vert-002-horiz-006-After}

Error: LaTeX failed to compile delete.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See delete.log for more info.
In addition: Warning message:
In in_dir(input_dir(), expr) :
  You changed the working directory to E:/Cyr/Quality failed parts/Quality test calibrate (probably via setwd()). It will be restored to C:/Users/cras/OneDrive - Edmund c/Desktop. See the Note section in ?knitr::knit
Execution halted

I would again appreciate your help cause I am really dependent to this.

Thanks

0 Answers0