5
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 columns that in their last 5 values (line 46 up to line 50) contain at least 1 NA value.
Well, I’ve been using the dplyr
. I can do it with him?
Some help?