scinot | R Documentation |
This function will convert any numeric vector
scinot(v, digits = 3)
v |
The input numeric object. It can be a single value or a vector |
digits |
An integer indicating how many significant digits to show. Default is 3. |
An object of class _expression_.
# Usage on single value
scinot(0.00000543)
# Demonstration on a vector
numbers<-c(3.456e-12,0.00901,5670000,-3.16e18,0.000004522,rnorm(5,sd=0.0000001))
plot(0,xlim=c(0,10),ylim=c(0,10),type="n")
text(c(2,6),c(10,10),labels=c("Before","After"),font=2)
for(i in 10:1){
text(c(2,6),c(i-1,i-1),labels=c(numbers[i],scinot(numbers)[i]))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.