[R] Sweave and the "[" function

Ross Darnell r.darnell at uq.edu.au
Tue Sep 5 04:11:17 CEST 2006


I am wanting to use the "[" operator in an S-chunk, e.g.


<<>>=
str(women)
women$height
women[,1]
"["(women,1)
@

to show the equivalence of  three methods of extracting an element from 
a data.frame.

However Sweave returns the last of these as

women[1]

in the S input chunk

How can I force it not to do this and return "["(women,1)



More information about the R-help mailing list