[R] R is converting arg input to scientific notation, which is bad!

peter dalgaard pdalgd at gmail.com
Fri Jun 20 19:50:30 CEST 2014


On 20 Jun 2014, at 04:30 , David Winsemius <dwinsemius at comcast.net> wrote:

> I think it's your `digits = 0` argument:
> 
>> formatC(20, digits = 3, width = 3, flag = "0")
> [1] "020"

At any rate, sprintf() is often more convenient:

> sprintf("%03d.csv", c(30, 104, 223))
[1] "030.csv" "104.csv" "223.csv"


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list