rank(x, na.last = TRUE,
ties.method = c("average", "first", "random", "max", "min"))
x a numeric, complex, character or logical vector.
na.last for controlling the treatment of NAs. If TRUE, missing values in the data are put last; if FALSE, they are put first; if NA, they are removed; if "keep" they are kept with rank NA.
ties.method a character string specifying how ties are treated, see ‘Details’; can be abbreviated.