In RStudio:
- Press the gear shift button next to the knit.
- Select output options.
- Click "Advanced."
- Click "Save tex source file.",
To answer the 1st comment, here are some LaTeX examples
\begin{Shaded} \begin{Highlighting}[] \NormalTok{DF <-}\KeywordTok{read.table}\NormalTok{(} \DataTypeTok{text=} \StringTok{"Year State Histadrut Private} \StringTok{1985 27 26 47} \StringTok{1993 10 14 76} \StringTok{"}\NormalTok{, }\DataTypeTok{header=}\OtherTok{TRUE}\NormalTok{)} \KeywordTok{library}\NormalTok{(ggplot2)} \KeywordTok{library}\NormalTok{(reshape2)}
compiled
some simple RMD
```{r} DF <-read.table( text= "Year State Histadrut Private 1985 27 26 47 1993 10 14 76 ", header=TRUE) library(ggplot2) library(reshape2) ```
The result looks like this: 
source share