From: Lam Phung Khanh [[email protected]]
Sent: Wednesday, May 30, 2012 10:54 PM

Note that I used knitr to test this, not Sweave. knitr is newer, has more 
features, and can do everything that Sweave can and a lot more. To use it, add 
the module Rnw (knitr) instead of Sweave. Is there a reason you want to use 
Sweave?

>I got error: "LyX: cannot convert file" when compiled it. My suspect is LyX 
>cannot handle the '$' sign in Sweave >code chunk. When I used another way to 
>write the last code line, it worked fine:

I don't think this is a LyX or a knitr error but a problem with your R code. R 
gives me the following error:

a <- c(1:10)
b <- c(11:20)
d <- cbind(a, b)
d$a
Error in d$a : $ operator is invalid for atomic vectors

The following runs fine for me in R and in LyX + knitr

a <- c(1:10)
b <- c(11:20)
d <- data.frame(a, b)
d$a

>Please forgive me if this email disturbs you.
Of course not! Feel free to ask any question about LyX + knitr.

Scott

Reply via email to