Skip to content
Prev 173942 / 398506 Next

R-code in html help pages: syntax highlighting

Duncan Murdoch wrote:
I would assume this would be outsourced to the experimental parse_Rd 
function
That is an issue. I guess I will fall back on what the parser says and 
infer on the scoping. Within the lines below, mean would be different 
each time

mean( 1:10 )
lapply( 1:10, mean)
mean <- (1+4) / 2
lapply( list( mean, median), function( f ) f( 1:10) )
{ mean <- median; mean( 1:10 ) }
There is probably some middle ground between the job an highlighter 
would do, and the way the R evaluator would think the expression 
eventually. Given that this is more a nice to have feature, I guess we 
can accept some errors. checkUsage is wrong sometimes, but it is still a 
good tool.
Deal
That is good news