[ESS] '$' sign in R code

Brian Diggs diggsb at ohsu.edu
Tue Sep 14 20:24:19 CEST 2010


On 9/14/2010 10:49 AM, Tengfei Yin wrote:
> Thanks, Douglas and Brian~
>
> @Brian:
>
> I try to put
>
> ; font-lock for noweb
> (require 'noweb-font-lock-mode)
>
> in my .emacs, but it still doesn't work on my laptop..
>
> Regards
>
> Tengfei

I'm not sure. It works for me, but I realize that isn't helpful for you. 
  I'm running:

XEmacs 21.4 (patch 22) "Instant Classic" [Lucid] (i586-pc-win32) of Tue 
Jan 06 2009 on VSHELTON-PC2
and ess 5.11
on a Windows XP Pro box

It also works out-of-the-box (without any changes) with Aquamacs 2.1 on 
my home (MacOS 10.5) laptop.

noweb-font-lock-mode is part of ESS, so maybe you need a newer version 
of ESS?  What versions of everything are you running?

> On Tue, Sep 14, 2010 at 12:33 PM, Brian Diggs<diggsb at ohsu.edu>  wrote:
>
>> On 9/13/2010 10:36 AM, Tengfei Yin wrote:
>>
>>> Hi dear all,
>>>
>>> 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?
>>>
>>>
>>> df[df$X_STATE==6,'X_STATE']<- 'CA'  # $
>>>
>>>
>>> My system:
>>>
>>> Ubuntu 10.04 64 bit, emacs 23.1.1, ess 5.11-1
>>>
>>> Thanks
>>>
>>> Tengfei
>>>
>>
>> Tengfei,
>>
>> I had that problem too, and then I discovered noweb-font-lock-mode which
>> fixed it.  I just added:
>>
>> ; font-lock for noweb
>> (require 'noweb-font-lock-mode)
>>
>> to my init.el file.
>>
>> --
>> Brian S. Diggs, PhD
>> Senior Research Associate, Department of Surgery
>> Oregon Health&  Science University

-- 
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University



More information about the ESS-help mailing list