Re: [R] how to work with Year-Month dates

2010-09-17 Thread Joshua Wiley
I had started thinking of writing my own class...this is much nicer. Thanks! Josh On Fri, Sep 17, 2010 at 12:27 PM, Henrique Dallazuanna wrote: > > Try this: > > library(zoo) > as.yearmon(x, "%Y-%B") > > > On Fri, Sep 17, 2010 at 4:23 PM, Joshua Wiley > wrote: >> >> Hi all, >> >> Is there a bu

Re: [R] how to work with Year-Month dates

2010-09-17 Thread Henrique Dallazuanna
Try this: library(zoo) as.yearmon(x, "%Y-%B") On Fri, Sep 17, 2010 at 4:23 PM, Joshua Wiley wrote: > Hi all, > > Is there a built in or easier way to work with dates that are *just* > Year-Month? > Right now I paste() on a day as a work around, but it ultimately needs to > be > in Year-Month fo

[R] how to work with Year-Month dates

2010-09-17 Thread Joshua Wiley
Hi all, Is there a built in or easier way to work with dates that are *just* Year-Month? Right now I paste() on a day as a work around, but it ultimately needs to be in Year-Month form, so then I use format() to get rid of the day. x <- c("2006-December", "2006-July") x <- paste(x, "-01", sep='')