I have such a data frame:
df <- structure(list(a = c(NA, NA, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L), b = c(NA, NA, NA, 1L, 2L, 3L, 4L, 5L, 6L, 7L), d = c(NA, NA,
If you got small number of columns, I suggest:
data.frame( a=sort(example$a, na.last=T), b=sort(example$b, na.last=T), d=sort(example$d, na.last=T))
Best, Adii_