Convert any numeric columns that you don't want as numeric to character:
habitats_df$v1 <- as.character(habitats_df$v1)
> stargazer(habitats_df, summary = F)
% Table created by stargazer v.4.5.3 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Wed, Jan 22, 2014 - 11:23:59
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}} ccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
habitat & v1 & v2 \\
\hline \\[-1.8ex]
beach & 0 & $0.005$ \\
grassland & 0.67 & $0.824$ \\
freshwater & 0.032 & $0.012$ \\
\hline \\[-1.8ex]
\normalsize
\end{tabular}
\end{table}
As for the "why", it's because otherwise numbers aren't typeset correctly. If you have negative values, math mode will use a longer dash, and it will allow LaTeX to control the number of digits printed. Otherwise, as you can see above, if you want to exert control over the number of digits, you'll have to do that using sprintf
in R.