Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in R Programming by (50.2k points)

Hi! I want to learn how to turn values into scientific notation. 

Can someone please help me out!

1 Answer

+1 vote
by (108k points)

Let us consider the below vector:

a<-c(0.1324,0.0001234,234.21341324,09.324324)

You can convert it into scientific notation using the “formatC()” function:

formatC(a,format="e")

This result would be as follows:

[1]  "1.3240e-01" "1.2340e-04" "2.3421e+02" "9.3243e+00"

Browse Categories

...