Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread Matt Curcio
Michael, Got it, thanks. Looking over the man file realized it is FLAG not flat. Cheers, M On Sun, Jul 31, 2011 at 2:26 PM, Matt Curcio wrote: > Hmmm... > Got this error > > Error in formatC(i, width = 4, format = "d", flat = "0") : >  unused argument(s) (flat = "0") > > Any ideas, > M > > On Su

Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread R. Michael Weylandt
Sorry, a typo on my end: argument is flag, not flat... On Jul 31, 2011, at 1:26 PM, Matt Curcio wrote: > Hmmm... > Got this error > > Error in formatC(i, width = 4, format = "d", flat = "0") : > unused argument(s) (flat = "0") > > Any ideas, > M > > On Sun, Jul 31, 2011 at 1:30 PM, Matt Curc

Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread Matt Curcio
Hmmm... Got this error Error in formatC(i, width = 4, format = "d", flat = "0") : unused argument(s) (flat = "0") Any ideas, M On Sun, Jul 31, 2011 at 1:30 PM, Matt Curcio wrote: > Greetings all, > I would like to append a 4 digit number suffix to the names of my > files for later use.  What

Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread Henrik Bengtsson
See ?sprintf (and/or search the web for sprintf), e.g. filename <- sprintf("kegg.subrichcdt.%04d.txt", i) /Henrik On Sun, Jul 31, 2011 at 10:30 AM, Matt Curcio wrote: > Greetings all, > I would like to append a 4 digit number suffix to the names of my > files for later use.  What I am using now

Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread R. Michael Weylandt
It might be more efficient to do the following though: i = 1:1000 fileNames = paste("kegg.subrichcdt.",formatC(i,width=4,format="d",flat="0"),".txt",sep="") So you now only have one vector containing all the names: then for (i in 1:1000) { temp = ## WHATEVER MAKES TEMP write.table(temp,file = f

Re: [R] Appending 4 Digits On A File Name

2011-07-31 Thread R. Michael Weylandt
I think this will do it: formatC(i,width=4,format="d",flag="0") Michael Weylandt On Sun, Jul 31, 2011 at 12:30 PM, Matt Curcio wrote: > Greetings all, > I would like to append a 4 digit number suffix to the names of my > files for later use. What I am using now only produces 1 or 2 or 3 or >