If my dataframe looks something like this
employee <- c('John','Peter','Jolie', 'Susan', 'Mark', 'David')
a <- c(21000, NA, 26800, NA, NA ,NA)
b <- c(NA, 35000, NA, NA, NA, NA)
c <- c(NA,NA,NA,40000, 20000, 45000)
d <- as.Date(c('2010-11-1','2008-3-25',NA, NA,'2007-3-14', NA))
e <- as.Date(c(NA, NA, NA,'2014-6-1', NA,'2017-10-15'))
f <- as.Date(c( NA, NA,'2010-3-20',NA, NA, NA))
employ.data <- data.frame(employee, a,b,c,d,e,f)
is there a way to coerce the data to remove the NAs and consolidate this to three columns? So it would look like:
John 21000 2010-11-1
Peter 35000 2008-3-25
Jolie 26800 2010-3-20
Susan 40000 2014-6-1
Mark 20000 2007-3-14
David 45000 2017-10-15