I'm currently writing a paper for my bachelor thesis with LaTeX. I'm pretty new to LaTeX and I was wondering whether I can modify the R output in LaTeX.
For Example:
If I type in this:
<<echo=FALSE>>=
Data <- read.csv('./Daten/osp.csv')
nrow(Data)
@
I get the following output:
[1] 1000
and the output appears in a new line.
Is it possible to place the output in the same line where the text is and is it possible to get rid of the [1]?
Thank you very much!
Best Answer
Here is an example of getting the output out in the LaTeX output without any "R" stuff. %%% Save this file as filename.Rnw and then run knitr or sweave followed by pdflatex and a pdf viewer.
I strongly recommend that you use knitr rather that sweave. There are more options available and you do not have to install any packages into the latex (*.Rnw) file. Documentation and information for knitr at http://yihui.name/knitr/
Here is the output of the above code.