Sunday, February 12, 2012

tikzDevice and knitr

Ubuntu's late packages are based on texlive 2009.
Latest is texlive 2011; so I updated to it but I started getting this error

Error in get("tikz", envir = as.environment("package:tikzDevice"))(..., : Graphics API version mismatch

Error was due to tikzDevice package being older than what knitr package expects
To fix this problem, install the repository version of tikzDevice

install.packages( 'tikzDevice', repos = 'http://r-forge.r-project.org' )

After that all is good. (ref thread)

2 comments:

  1. Thanks for posting the solution :)

    This is the answer to FAQ 1: https://github.com/yihui/knitr/blob/master/FAQ.md

    ReplyDelete
  2. I should've RTM! :) The problem was that I was using Ubuntu distributed R, which is out of date. It didn't have the correct packages.

    ReplyDelete