mercredi 15 septembre 2021

Nested ifelse in column containing dates in R

I am new to R and I am trying a simple nested ifelse operation, where I want the view_date should lie between start_date and end_date. I used to do this in excel, but since the data set is too large for excel to handle, I am switching it to R. Can you help me with that?

Query: df1$check <- ifelse(df1$view_date>=df1$start_date, ifelse(df1$view_date<=df1$end_date,1,0),0)

Error: Error in charToDate(x) : character string is not in a standard unambiguous format

Aucun commentaire:

Enregistrer un commentaire