I am trying to print a nice looking vector in Sweave.

c <- 1:4

I want to see (1, 2, 3, 4) in TeX. .

If I use
paste(c, ",", sep="")
I get
 "1," "2," "3," "4,"

If use cat(c, sep=",")
I can't seem to assign it to an object,
1,2,3,4> myvec <- cat(c, sep=",")
1,2,3,4> myvec
NULL

and if I bypass the object assignment and put
"My vector is (\Sweave{cat(c, sep=",")}). "
prints out
"My vector is (). "

Suggestions?


Robin Jeffries
MS, DrPH Candidate
Department of Biostatistics
UCLA
530-624-0428

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to