http://d.hatena.ne.jp/isseing333/20110126/1296022021 の関数を書く
comma <- function(n) { out <- function(n) { if (n < 1000) return(as.character(n)) else sprintf("%s,%03s", out(n %/% 1000), n %% 1000) } s <- unlist(strsplit(as.character(n), "\\.")) return(sprintf("%s%s%s", ifelse(n < 0, "-", ""), out(abs(as.numeric(s[[1]]))), ifelse(length(s) == 2, sprintf(".%s", s[[2]]), ""))) }