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

2014-06-20 Thread efridge
The digits argument for formatC is for sigfigs. I found a solution within the formatC argument list. When I added the format arg to formatC: filenames <- paste0(formatC(id, digits = 0, width = 3, format = "d", flag = "0"), ".csv") ..it miraculously worked. d is the format value for integers. Hope

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

2014-06-20 Thread peter dalgaard
On 20 Jun 2014, at 04:30 , David Winsemius 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 Da

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

2014-06-19 Thread David Winsemius
On Jun 19, 2014, at 12:08 PM, efridge wrote: > Hello, > > Firstly, real new to R here. > > I have a function intended to evaluate the values in columns spread over > many tables. I have an argument in the function that allows the user to > input what sequence of tables they want to draw data fr

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

2014-06-19 Thread efridge
Hello, Firstly, real new to R here. I have a function intended to evaluate the values in columns spread over many tables. I have an argument in the function that allows the user to input what sequence of tables they want to draw data from. The function seems to work fine, but when the user inputs