Re: [R] Check Dates

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 9:42 AM, nvanzuy...@gmail.com wrote: Dear Kevin, Assuming that closure and referral are two columns in your df and you have already converted them to date columns. The following should work: df$Dec04<- ifelse(df$referral <"2005-01-01" & df$closure > "2003-12-31" | d

Re: [R] Check Dates

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 9:29 AM, Wang, Kevin (SYD) wrote: Hi, I'm trying to check a column of dates and creating indicator variables showing different time periods. For example, if I were to do this in Excel I would have something like: Year to Dec 2004=IF(AND(referral datedate>DATE(2003,1

Re: [R] Check Dates

2010-07-10 Thread nvanzuydam
Dear Kevin, Assuming that closure and referral are two columns in your df and you have already converted them to date columns. The following should work: df$Dec04<- ifelse(df$referral <"2005-01-01" & df$closure > "2003-12-31" | df$closure== "", "Yes", "No") if you are trying to account for

[R] Check Dates

2010-07-10 Thread Wang, Kevin (SYD)
Hi, I'm trying to check a column of dates and creating indicator variables showing different time periods. For example, if I were to do this in Excel I would have something like: Year to Dec 2004=IF(AND(referral dateDATE(2003,12,31), LEN($closure date) = 0)), "Yes", "No") for the "Year to Dec