Convert numeric vector to character in scientific notation.

sciNot(x)

Arguments

x

Numeric vector.

Value

Character vector the same length as x, containing representation in scientific notation of each element in x.

Details

Takes a numeric vector, x, and returns a corresponding character vector the same length as x. Elements of the return vector are representations of corresponding elements of x in scientific notation. This is handy for use with 'labels' argument to ggplot2:: 'scales' functions:

scales_x_log10(labels=sciNot)

See also

scale_continuous

Author

David Braze davebraze@gmail.com