Re: [R] date columns chooser

2012-03-07 Thread peter dalgaard
On Mar 7, 2012, at 19:06 , henk harmsen wrote: > i have a data frame with 2 columns of dates. > with str(dataframe) i have ensured myself that they were indeed formatted > as dates. > one column has NA's in it. > > the aim is now to make a third column that chooses date1 if it is a date, > and c

[R] date columns chooser

2012-03-07 Thread henk harmsen
i have a data frame with 2 columns of dates. with str(dataframe) i have ensured myself that they were indeed formatted as dates. one column has NA's in it. the aim is now to make a third column that chooses date1 if it is a date, and choose date2 if it is a NA. i am trying df$date3=ifelse(is.na(d