Hello,
when I want to identify complete cases across several columns using dplyr it will not work if columns are of different types. How to code to solve this error?
My code looks like this:
library(tidyverse)
dbase <- starwars |> rowwise() |>
mutate(compcases = ifelse(complete.cases(c_across(c(name : mass, birth_year)))==TRUE, 1, NA))
I get the message:
Caused by error in vec_c()
:
! Can't combine name
and height
.
I would like to code using pipe operator and cannot figure out how to overcome this. Help appreciated.
Cheers