Showing posts with label knitr. Show all posts
Showing posts with label knitr. Show all posts

Monday, October 21, 2013

ESS (Emacs Speaks Statistics) now supports compiling knitr

First, new version of ESS needs to be installed.  I use Aquamacs, so I want to make sure that I update Aquamacs. You can do this by uncommenting appropriate lines in Makeconf file of the ESS distribution (search for Aquamacs in Makeconf file).

Two variables need to be set within emacs.

  • Change 'ess-swv-processor' to 'knitr'
  • Set the variable 'ess-swv-plug-into-AUCTeX' to use the existing interface for compiling LaTeX files: i.e., C-c C-c
Now you should be able to use 'C-c C-c Sweave' or 'C-c C-c LaTeXSweave' commands to compile your Rnw files.

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)

Friday, February 3, 2012

"knitr" and "ggplot2" for Automatic LaTeX Report Generation with R

knitr is supported under R versions >2.14.1. So I upgraded R, and also needed some extra packages for ggplot2. (probably not all are required for ggplot2 but I am interested in using these packages in my research)

sudo apt-get install libX11-dev libglu1-mesa-dev libxml2-dev libgeos-dev libproj-dev libgdal-dev

Some R packages as well

install.packages(c("rgdal","maps","maptools","rgeos"))

Only, then, was I able to install knitr package according to this post.

install.packages("devtools")
library(devtools)
install_github("ggplot2","hadley")

install_github("knitr","yihui")