[R] Cleaning data

bayan sardini sardinibayan at gmail.com
Tue Sep 26 11:50:00 CEST 2017


Hi 

I want to clean my data frame, based on the age column, whereas i want to delete the rows that the difference between its elements (i+1)-i= integer. i used 

a <- diff(df$age)
for(i in a){if(is.integer(a) == true){df <- df[-a,]
}}

but, it doesn’t work, any ideas

Thanks in advance
Bayan


More information about the R-help mailing list