In a data frame where all colums contain either missing or the same data, how can I get a vector with all the data and nothing missing, assuming no colum has all the values.
Example data frame here as I'm struggling to describe what I mean
x <-data.frame(c( "r", "t", "", "y"), c("", "t", "x", "y"), c("r","","x", ""))
desired output would be a vector like the one given with c("r", "t", "x", "y")
, or a column like that.
I have tried using duplicated
and distinct but haven't managed to work it.