I have this personal dataframe,
set.seed(1)
df <- data.frame(A = 1:50, B = 11:60, c = 21:70)
head(df)
df.final <- as.data.frame(lapply(df, function(cc) cc[ sample(c(TRUE, NA), prob = c(0.85, 0.15), size = length(cc), replace = TRUE) ]))
I want to delete the columns that in their last 5 values (line 46 to line 50) contain at least 1 NA value.
Well, I've been using dplyr
a lot. Can I do this with him?
Any help?