[R] Using package "exams" and xtable

Dieter Menne dieter.menne at menne-biomed.de
Wed May 27 09:52:33 CEST 2009




M Berg wrote:
> 
>>str(rx)
> num [1:16] 21 9 8 18 4 12 17 2 9 7 ...
> 
> I want to print out the entire vector as part of the problem.
> When I use \Sexpr(rx) only the first value (in this case 21) is printed
> out.
> 
> 

rx = 1:10
rxs = paste(rx,collapse=", ")

So 

\Sexpr{paste(rx,collapse=", ")} 

should work, but I always prefer

\Sexpr{rxs}

because it is easier to read. And make sure you spell out "collapse" fully,
because it occurs after the .... 
I got bitten for my laziness a few times

Dieter


-- 
View this message in context: http://www.nabble.com/Using-package-%22exams%22-and-xtable-tp23731879p23737771.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list