这是示例数据:
# create table data
year <- c("2010", "2011", "2012")
value <- ("5", "10", "15")
df<-data.frame(year, value)
# print
print(xtable(df,digits=c(0,0,1)))
如何格式化 5、10 和 15 以显示为 $5.0、$10.0 和 $15.0?
可能提供帮助的 R 包是xtable、stargazer和/或Hmisc.
在 内xtable,解决方案可以在format.args:“formatC函数的参数列表。例如,标准德语数字分隔符可以指定为format.args=list(big.mark = "’", decimal.mark = ","))。” - http://cran.r-project.org/web/packages/xtable/xtable.pdf
谢谢