I'm using lstlisting
to include my R code in my LaTeX, however, the minus sign after <
is not appearing in the compiled file.
\usepackage{listings}
\begin{document}
\begin{lstlisting} [language=R]
n<- c(10, 15, 20, 35)
w <- c(300, 500, 700,100)
i <- c(1, 1, 2, 2)
j <- c(1, 2, 1, 2)
beta <- c(1, 1)
for (iter in 1:20) {
alpha <- sqrt(tapply(w*n^2/beta[j], i, sum)/
tapply(w*beta[j], i, sum))
beta <- sqrt(tapply(w*n^2/alpha[i], j, sum)/
tapply(w*alpha[i], j, sum))}
alpha
1 2
11.41714 24.63072
beta
1 2
0.8229245 1.3470172
\end{lstlisting}
\end{document}
\begin{document}
and\end{document}
this could be usefull