R语言-格式化输出

R语言格式化输出,数字前补足0:

> a<-c(1,2,4,11,123)
> a
[1]   1   2   4  11 123

> b<-formatC(a,width=3,flag='0')
> b
[1] "001" "002" "004" "011" "123"
>


posted @ 2015-11-11 11:12  hongweigg  阅读(8)  评论(0)    收藏  举报