A little bit like here, I would like to extract the first digit from each element of a numeric vector, without having it to turn into a character vector and back.
d <- c(123, 2, 45)
Expected Output:
[1] 1 2 4
I tried different stuff with floor(), but without the desired result.