r – why mixedsort does not work as expected when using decimal values

Mixedsort of gtools does not work as expected. Example below:

library(gtools)
df <- data.frame(matrix(ncol = 1, nrow = 8))
x <- c("buckets")
colnames(df) <- x
buc = c("-Inf","0.5","1.5","2.5","7.5",  "11.5", "27.5", "Inf")
df$buckets <- buc
df$buckets <- (as.character(df$buckets))
df$rank = as.numeric(as.character(order(mixedsort(df$buckets))))
print(df)

I expected 2.5 to be ranked before 7.5 but it did not work.