Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

10 November 2007

Significant Digits in R CRAN

I get a bit sick of scientific notation in R. And when I try to turn it off, I get sick of all the decimal places. These options seem to mostly stop scientific notation and give a happy number of decimal places.

options(scipen = 6) # bias against scientific notation
options(digits = 1) # show fewer decimal places
  • 4:11pm
  •  
  • R

Comments

  1. Hey thanks a lot for this!!! I’ve been trying to find out how to do this – and it works really well! It killed those annoying e^-1 notations :D

    aussie / 5:55am / 1 March 2008

  2. I’m glad it was helpful to someone.

    Ryan / 8:48am / 1 March 2008

  3. Indeed — it was helpful. Thanks much for posting it.

    Robin M. / 7:45pm / 2 April 2008

  4. thanks from me as well, this is really great.

    Geneorama / 3:39am / 6 February 2009

  5. was very helpful, thank you

    Stephanie Rickett / 4:09am / 18 August 2010

  6. thanks for the help!

    thanks for the help! / 8:16am / 1 February 2012

  7. Thanks for the e notation code. My script was getting hung up on it. All clear now!

    thin_vegetarian / 6:44pm / 23 August 2012

  8. Thanks. Appreciate the simplicity and straight to the pointed-ness. (And of course the fact that it worked exactly as you said.)

    BGTP / 12:32am / 30 March 2013

Leave a comment

Markdown

0.096 seconds