Wrapping something should be in a paragraph. Hence critical part of your file should be (corrected in your file now):
\lipsum
\begin{wrapfigure}{l}{.525\textwidth} %this figure will be at the right
\includegraphics[width=.525\textwidth]{T vs R - tungsten filament.png}
\begin{center}
Figure 3
\end{center}
\end{wrapfigure}
%\lipsum
(Observe the position of `\lipsum).
BTW: Replacing all text \\
's by blank lines would help (La)TeX to correct dividing paragraphs into lines.
Edit New version:
$\,$
\begin{wrapfigure}{l}{.525\textwidth} %this figure will be at the right
\includegraphics[width=.525\textwidth]{T vs R - tungsten filament.png}
\begin{center}
Figure 3
\end{center}
\end{wrapfigure}
\lipsum
I think that you can accomplish your goal by adding floating = FALSE
in your call to print.xtable()
.
\documentclass[a4paper,12pt, english]{article}
\usepackage{graphicx}
\usepackage{wrapfig}
\begin{document}
sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1
\begin{wraptable}{r}{0.5\textwidth}
<<chunk_table, results="asis", echo=FALSE>>=
library(xtable)
print(xtable(head(iris[,c(1,2)])), floating = FALSE)
@
\caption [Iris]{Table iris caption, Table iris caption, Table iris caption, Table iris caption, Table iris caption, Table iris caption}
\end{wraptable}
sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1, sample text 1
\end{document}
Best Answer
I'm gonna answer my own question, in case someone stumbles over this.
I used the cutwin package, as suggesten in this thread. (Thanks Schumacher for the link). The output came out pretty nice. Below is the actual code I used in my report.