Kyle Matoba <kmmatoba <at> ucdavis.edu> writes: > A question in my work I use \Sexpr{} statements scalar values and the xtable > package for all manner of tables. What I'd like to do is to use a vector > inline, rather than a whole separate table. Something like: > > % Sweave block: > <<>>= > covmat <- cov(matrix(runif(100),ncol=3)) > @ > > % back to Latex, typing up a report, my homework, etc. > The first column of the covariance matrix is $(\Sexpr{covmat[1,1]}, > \Sexpr{covmat[2,1]}, \Sexpr{covmat[3,1]})^T$ >
To unclutter the text in Sexpr, I normally prepare the results in the Sweave block in advance Dieter covmat <- cov(matrix(runif(30),ncol=3)) ft = paste(round(covmat[,3]),collapse=", ") ft named = c(Val=3,StdDev=4,p=0.4) ft = paste(names(named),named,sep="= ",collapse=", ") ft ______________________________________________ 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.