Hi Sven,

Thanks for your suggestions!!

This works fine for \Sexp{whatever$blabla}, but sometimes I want to show the
code chunk with $ sign in some case, like a documentation or tutorial that
describe function of $, I have to put a # $ as a comment after the line I
use $ sign, so if sometimes I set keep.source=TRUE, the comment will show
up, and it's not pretty if this workaround s used for publication.

......when I write this question, I just find another workaround, instead of
putting a #$ in comment of code chunk, I put a %$ in comment of latex file,
this looks wired, but it works.

Thanks again!!

Tengfei

On Mon, Sep 13, 2010 at 1:14 PM, Sven Hartenstein
<lists@svenhartenstein.de>wrote:

> Dear Tengfei,
>
> > In a R code chunk, when I use data frame 's $ accessor to subset it,
> > I have to put another $ in the comment, or the latex will treated as
> > math mode?
>
> This has been discussed before. See this thread:
> https://stat.ethz.ch/pipermail/ess-help/2009-November/thread.html#5679
>
> What I do is thus:
>
>  df[df[["X_STATE"]]==6,'X_STATE'] <- 'CA'
>
> Best,
>
> Sven
>
> ______________________________________________
> ESS-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>



-- 
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274
Homepage: www.tengfei.name

	[[alternative HTML version deleted]]

