I want to count the number of digits before the decimal point for a numeric vector x with numbers greater or equal to 1. For example, if the vector is
x <- c(2.85, 356.01, 66.1, 210.0, 1445.11, 13.000)
my code should return a vector containing integers 1, 3, 2, 3, 4, 2
Does any know how to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…