library(xtable)
library(rattle)
set.seed(42)
obs <- sample(1:nrow(weatherAUS), 5)
vars <- 2:7
xtable(weatherAUS[obs, vars])
我得到以下带有代码的输出,为什么我不能得到格式化的表格?
% latex table generated in R 2.15.1 by xtable 1.7-1 package
% Sat Apr 6 17:02:37 2013
\begin{table}[ht]
\centering
\begin{tabular}{rlrrrrr}
\hline
& Location & MinTemp & MaxTemp & Rainfall & Evaporation & Sunshine \\
\hline
60992 & Hobart & 5.60 & 13.00 & 7.60 & 1.60 & 3.10 \\
62476 & Launceston & 7.40 & 13.50 & 8.80 & & \\
19077 & Williamtown & 18.30 & 29.10 & 3.20 & 1.00 & 7.00 \\
55366 & PerthAirport & 9.80 & 21.90 & 0.00 & 3.60 & 9.80 \\
42784 & GoldCoast & 23.40 & 30.40 & 0.00 & & \\
\hline
\end{tabular}
\end{table}