Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:48:08+00:00 2026-06-05T06:48:08+00:00

I am running regressions in R using lm() function and I can’t manage to

  • 0

I am running regressions in R using lm() function and I can’t manage to display results in simple format. I need to print a vector of p-values:

> summary(lm)$coef[,4]
  (Intercept)           lun          d1un 
 1.433706e-01 4.673723e-158  6.629044e-04 

How can I override scientific notation and get reasonable precision? I tried options(scipen=1000), but it displays endless lines of digits, somehow options(digits=7) does not work here.

I know I can use things like format and sprints, but I would like to set the default display rule for all numeric output, e.g. not more then 6 decimals.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:48:09+00:00Added an answer on June 5, 2026 at 6:48 am

    I don’t think this will be possible, for general display throughout R. ?options says this about digits:

     ‘digits’: controls the number of digits to print when printing
          numeric values.  It is a suggestion only.  Valid values are
          1...22 with default 7.  See the note in ‘print.default’ about
          values greater than 15.
    

    The key phrase is “It is a suggestion only”.

    Next, note that what is printed is at first governed by the print() method applied (this is hidden during interactive use, because R auto-print()s). For details see ?print and ?print.default for the basic methods. From ?print.default we note

    digits: a non-null value for ‘digits’ specifies the minimum number of
            significant digits to be printed in values.  The default,
            ‘NULL’, uses ‘getOption(digits)’.  (For the interpretation
            for complex numbers see ‘signif’.)  Non-integer values will
            be rounded down, and only values greater than or equal to 1
            and no greater than 22 are accepted.
    

    and in the Details section we have:

       The same number of decimal places is used throughout a vector.
       This means that ‘digits’ specifies the minimum number of
       significant digits to be used, and that at least one entry will be
       encoded with that minimum number.  However, if all the encoded
       elements then have trailing zeroes, the number of decimal places
       is reduced until at least one element has a non-zero final digit.
       Decimal points are only included if at least one decimal place is
       selected.
    

    The default for digits is NULL which indicates that getOption("digits") is used, but as we already noted, that is a guide only.

    There doesn’t appear to be a way to configure R to do what you want nor do it globally. You would need to rewrite print.default() or all the print() methods you needed to use and make those version be used instead of the standard versions — not easy now with NAMESPACES.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

running into a little issue, can't quite figure it out. I'm using jQuery on
Running into a problem. I have a table defined to hold the values of
-- Running within ASP.NET MVC alongside jQuery -- I'm using jQuery to render a
Running Mac OS X 10.5.8, with PHP 5.2.11 Pre-installed. Using Coda 1.6.10. I'm writing
Running the following code, I get a StackOverflowError at the getPackage() line. How can
I am using rpy2 for regressions. The returned object has a list that includes
Running a ruby on rails project on my mac. I need to test it
running this in IE9: if (typeof(JSON) === 'object' && typeof(JSON.parse) === 'function') { //
android.text.format.DateFormat specifies that using the format string 'a' should yield 'a' or 'p' and
running UNIX through putty, and using vi and gcc. I am attempting to read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.