我有以下矩阵
matrix(c(10000, 11000, 20000, 0, 4000, 5000))
xtable(x)
我希望这个格式的数字是10'000,11'000等。 关于如何做到这一点的任何想法?
答案 0 :(得分:0)
来自xtable
帮助:
x<-matrix(c(10000, 11000, 20000, 0, 4000, 5000))
require(xtable)
xtable(x)
print(xtable(x), format.args = list(big.mark = "'", decimal.mark = ","))
#% latex table generated in R 3.0.2 by xtable 1.7-1 package
#% Wed Jun 11 18:02:05 2014
#\begin{table}[ht]
#\centering
#\begin{tabular}{rr}
# \hline
# & x \\
# \hline
#1 & 10'000,00 \\
# 2 & 11'000,00 \\
# 3 & 20'000,00 \\
# 4 & 0,00 \\
# 5 & 4'000,00 \\
# 6 & 5'000,00 \\
# \hline
#\end{tabular}
#\end{table}