Call to render() fails but RStudio Knit button produces pdf

This has been a sort of confounding problem. I'm on a Windows 7 machine, using MikTex 2.9 as my LaTex installation. When I try to render even the default RMarkdown template using rmarkdown::render(''test.Rmd") I fail on a mysterious pandoc error Error: failed to compile test.tex

If I keep the intermediate test.tex and run >pdflatex test.tex, the pdf is produced properly.

What's even more confusing is if I use the RStudio knit button, the pdf is produced perfectly fine. If I check the intermediate pandoc command, the commands produced by render and knit are identical. I tried adding the verbose option, to the header as such, but I'm getting no extra information.

---
title: "Test"
output : 
     pdf_document:
          pandoc_args : ["--verbose"]

Sys.which('pdflatex') points to the correct pdflatex.exe as well

I'm not really sure what debugging steps I can take next, so any help would be appreciated!

I don't have a solution but it looks like this might be related to:

Note specifically the mention of:

I noticed that during compilation, an intermediate file with a tinytex extension was being created. After uninstalling tinytex, both the knit button and the call to render work

I now get a warning You are recommended to install the tinytex package to build PDF.FALSE

This warning is kind of inscrutable. Does anyone have any idea what happened with the interaction between tinytex and my local MikTex installation?

Hmm, I started the other thread and indeed the issue we saw are quite similar. However, when I tried your solution and removed tinytex, my issue remained. Same symptom and error message, so our issues are not exactly the same.