Dear R Users, I would like to include the p value in the results returned by the t.test function in a sentence of a LaTeX document. For this purpose, I use the following code (file.Rnw):
\documentclass{article} \begin{document} The p value for my data was <<echo=FALSE>>= x<-cbind(1,2,3) y<-cbind(3,4,5) t.test(x,y) @ which is not significant. \end{document} I use "R CMD Sweave file.Rnw" and "pdflatex file.tex" to create a PDF document of it. However, the all details of the t-test are included in my document and form a new paragraph in another format than the rest of the original sentence. The sentence should look like this: "The p value for my data was 0.2879 which was not significant." Thanks in advance. Julia Wassertemperaturen in Deutschland Sommer, Sonne, Strand - wer braucht Abkühlung? Die aktuellen Wassertemperaturen und Windgeschwindigkeiten für Deutschlands Badeseen gibt´s auf arcor.de. ______________________________________________ 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.