I want to paste together multiple columns but ignore NAs.
Here's a basic working example of what the df looks like and what I'd like it to look like. Does anyone have any tips?
df <- data.frame("col1" = c("A", NA, "B", "C"),
"col2" = c(NA, NA, NA, "E"),
"col3" = c(NA, "D", NA, NA),
"col4" = c(NA, NA, NA, NA))
df_fixed <- data.frame("col" = c("A", "D", "B", "C,E"))