Any numbers below 100 remain as they are. So 1 remain 1 and 10 remains 10 etc. 100 becomes 10^2, 1000 become 10^3 etc. If all numbers in the vector start with a 1 (like c(1, 10, 100, 1000)) then the leading 1x in 1x10^2 is omitted. If any number does not start with a 1, then the leading 1x or 3x or so are added.

sci10(x)

Arguments

x

vector of axis numbers to convert

Value

vector of modified numbers

Examples

sci10(c(NA,1,10,100,1000,NA))
#> expression(NA, 1, 10, 10^2, 10^3, NA)
sci10(c(NA,1,10,30))
#> expression(NA, 1, 10, 30)
# or pass to ggplot2::scale_y_log10(label = sci10)