I have many missing data in the data frame (data table), and I need to move them all to the right side. Are there any methods to do this?
Sample data
as.data.table(structure(list(`1` = c(NA_integer_, NA_integer_), `2` = c(NA,
1L), `3` = c(1L, 1L), `4` = c(0L, NA), `5` = c(NA_integer_, NA_integer_
)), row.names = c(NA, -2L), class = c("data.table", "data.frame"
)))
The expected output is as follows,
1, 0, NA, NA, NA
1, 1, NA, NA, NA