[R] Sweave and the "[" function

From: Ross Darnell <r.darnell_at_uq.edu.au>
Date: Tue 05 Sep 2006 - 02:11:17 GMT


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)



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Sep 05 12:17:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.