Dear Julia, 

my way to do that is to attribute the t.test to an object, 
and then refer to its p.value with the function 
\Sexpr

e.g. 
\documentclass{article}
\usepackage{Sweave}

\begin{document}
        
<<echo=FALSE>>=
        x<-cbind(1,2,3)
        y<-cbind(3,4,5)
        t <- t.test(x,y)
@
        
The p value for my data was \Sexpr{ round(t$p.value, 3) } 
which is not significant.

\end{document}


Best, 

Matthieu
Matthieu Dubois
Post-doctoral researcher
Department of Psychology and Neural Science, NYU

______________________________________________
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