Not an answer, just adding a full reprex of the above example you've given:
suppressPackageStartupMessages(library(dplyr))
d <- dplyr::starwars
numcols <- colnames(d)[vapply(d,
is.numeric,
logical(1))]
chrcols <- colnames(d)[vapply(d,
is.character,
logical(1))]
d$is_complete <- complete.cases(d[ ,
c(numcols, chrcols),
drop = FALSE])
dplyr::glimpse(d)
#> Observations: 87
#> Variables: 14
#> $ name <chr> "Luke Skywalker", "C-3PO", "R2-D2", "Darth Vader",...
#> $ height <int> 172, 167, 96, 202, 150, 178, 165, 97, 183, 182, 18...
#> $ mass <dbl> 77.0, 75.0, 32.0, 136.0, 49.0, 120.0, 75.0, 32.0, ...
#> $ hair_color <chr> "blond", NA, NA, "none", "brown", "brown, grey", "...
#> $ skin_color <chr> "fair", "gold", "white, blue", "white", "light", "...
#> $ eye_color <chr> "blue", "yellow", "red", "yellow", "brown", "blue"...
#> $ birth_year <dbl> 19.0, 112.0, 33.0, 41.9, 19.0, 52.0, 47.0, NA, 24....
#> $ gender <chr> "male", NA, NA, "male", "female", "male", "female"...
#> $ homeworld <chr> "Tatooine", "Tatooine", "Naboo", "Tatooine", "Alde...
#> $ species <chr> "Human", "Droid", "Droid", "Human", "Human", "Huma...
#> $ films <list> [<"Revenge of the Sith", "Return of the Jedi", "T...
#> $ vehicles <list> [<"Snowspeeder", "Imperial Speeder Bike">, <>, <>...
#> $ starships <list> [<"X-wing", "Imperial shuttle">, <>, <>, "TIE Adv...
#> $ is_complete <lgl> TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE,...
Created on 2018-02-23 by the reprex package (v0.2.0).