I am very new to using R and am trying to delete all rows from a dataframe after a time point where a condition is met, so for a particular column I wish to delete all rows if one date column is greater than the other date column only if another column does not have "None" in that row.
I have tried the script:
newdf <- for(df$ID in df)
if(df$Endpoint != "None" && df$VISITDATE>df$DATE)
This throws me an error -
df$Endpoint != "None" && df$VISITDATE > :
'length(x) = 17012 > 1' in coercion to 'logical(1)'
I really appreciate any help on this as have been on so many forums and no luck so far! (the above code I tried also may be very wrong as I am so new to all this)