I am having an issue with my mutate function. I am trying to get the difference between two dates and place that in a column for further analysis. I pulled the dates from a csv file and so they were imported as strings.
Using this code:
df%>%
rowwise()%>%
mutate(df,age_when_trade = ifelse(flag1 == TRUE && flag2 == TRUE,as.Date(date1,"%m/%d/%y") - as.Date(date2,"%m/%d/%y")))
I have been getting the below error
Error: impossible to replicate vector of size 13
I am using RStudio 0.98.978 and R version 3.0.2