0

I am just learning to use knitr to produce literate data analyses. I have come up with the anomaly that Xie's 'minimal.Rnw' produces a correct pdf in my laptop environment, but when I use R in my secure data store at UIHC, the graphic is left out. So far as I can tell, the environment is pretty much identical: R version 3.1.1 RStudio Version 0.98.1073 knitr version 1.6 miktek 2.9 Tekmaker 4.3 All my packages are up to date. The attached packages are different: Laptop:

> search()
 [1] ".GlobalEnv"        "tools:rstudio"     "package:stats"     "package:graphics" 
 [5] "package:grDevices" "package:utils"     "package:datasets"  "package:methods"  
 [9] "Autoloads"         "package:base"     

Repository machine:

> search()
 [1] ".GlobalEnv"        "package:lmerTest"  "package:lme4"      "package:Rcpp"     
 [5] "package:Matrix"    "tools:rstudio"     "package:stats"     "package:graphics" 
 [9] "package:grDevices" "package:utils"     "package:datasets"  "package:methods"  
[13] "Autoloads"         "package:base"   

Laptop OS: Windows 8.1 (alas) Repository machine OS: Windows 7, but I can't find the exact version.

When I run minimal.Rnw on my laptop, a subdirectory (figure) gets created in my workspace with the graphic file in it, and the graphic is included in the final pdf. When I run minimal.Rnw on my repository virtual machine, no subdirectory gets created. The figure is copied to the working directory as Rplots.pdf, but it doesn't get into the final pdf.

What's going on? How will I get figures into my own Rnw files when I am working on my repository machine?

Thanks in advance for any help that you can give me.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419

1 Answers1

1

My best guess is that you were using Sweave instead of knitr on your repository machine. If that is the case, you have to change the RStudio option.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419