You can use either the numprint package or the siunitx package in combination with \Sexpr. Using \text is not necessary. MWE:
\documentclass{article}
\usepackage{numprint}
\npthousandsep{,}
\usepackage{siunitx}
\sisetup{group-separator = {,}, group-minimum-digits = 4}
\begin{document}
<<echo=FALSE>>=
a <- 8000
@
$a_1=\numprint{\Sexpr{a}}$ % using numprint
$a_2=\num{\Sexpr{a}}$ % using siunitx
\end{document}
Result:

Of course when you use numprint you can delete the two lines about siunitx and vice versa. In general numprint is a bit easier to use but siunitx has (a lot) more features.
See also: Format long numbers with a thousand separator?, Preserving thousands separator with siunitx.