Re: [R] Writing "monthly" .txt or .csv files from a long time series

2014-06-18 Thread jim holtman
You probably want: write.table(x, file = as.character(x$mon[1L])) because 'input$mon[1]' will always pick the same month (first one in 'input') Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jun 1

Re: [R] Writing "monthly" .txt or .csv files from a long time series

2014-06-18 Thread Thomas Barningham
Hi David, Thank you for your help. The code you supplied is working, to an extent. However, i'm only outputting the first monthly file into my working directory. Apologies as I'm a relatively new to R, so please bear with my ignorance, have I not set up a loop correctly? Also, what is the purpose

Re: [R] Writing "monthly" .txt or .csv files from a long time series

2014-06-17 Thread David Winsemius
On Jun 17, 2014, at 5:00 AM, Thomas Barningham wrote: > Dear R users, > > I have a .txt file of time series data from the middle of 1999 through > to the end of 2012. There are two columns in the file, the first is a > decimal date, the second is an atmospheric tracer value and looks like > this

[R] Writing "monthly" .txt or .csv files from a long time series

2014-06-17 Thread Thomas Barningham
Dear R users, I have a .txt file of time series data from the middle of 1999 through to the end of 2012. There are two columns in the file, the first is a decimal date, the second is an atmospheric tracer value and looks like this: Date APO 1999.47945560 -168.48 1999.47948410 -158.08 1999.4795