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 9195977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:44:55+00:00 2026-06-17T21:44:55+00:00

using R-2.15.2 on Windows XP I get a different maximum from summary() than from

  • 0

using R-2.15.2 on Windows XP I get a different maximum from summary() than from max().
Why is that so?

Here is the relevant code:

> class(dat)
[1] "data.frame"
> dim(dat)
[1] 3850   54
> summary(dat$enrol)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    26     945    1744    3044    3128  183200 
> max(dat$enrol)
[1] 183151

Any ideas why summary() rounds the result up?

Best
Oliver

  • 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-17T21:44:56+00:00Added an answer on June 17, 2026 at 9:44 pm

    It is how the results are printed respecting the digits argument. The default is

    > max(3, getOption("digits")-3)
    [1] 4
    

    Why R rounds up is just the default rules in use – go to the nearest even digit. We can see this in action with signif():

    > signif(183151, digits = 4)
    [1] 183200
    

    which, as ?summary tells us, is what is used by summary() and is controlled by the digits argument:

    digits: integer, used for number formatting with ‘signif()’ (for
            ‘summary.default’) or ‘format()’ (for ‘summary.data.frame’).
    

    Read ?signif for more on the rounding issue.

    To get more significant digits, pass a higher number to summary() via the digits argument.

    For example

    > set.seed(1)
    > vec <- c(10, 100, 1e4, 1e5, 1e6) + runif(5)
    > summary(vec)
         Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
         10.3     100.4   10000.0  222000.0  100000.0 1000000.0 
    > summary(vec, digits = 7)
         Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
         10.3     100.4   10000.6  222022.5  100000.9 1000000.0 
    > summary(vec, digits = 8)
         Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
         10.3     100.4   10000.6  222022.5  100000.9 1000000.2 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following piece of code to get all windows: CFArrayRef windows =
I've been using the below code in order to get the Windows License Key.
I'm in a ASP.NET application using Windows Authentication. I'm using HttpContext.Current.User.Identity.Name to get the
I am using the windows API in C++ and I want to get the
How can I get the Original Install Date of the Windows using C#?
Is there a way to get Windows audio mixer levels using WMI? For example,
Is there a way (on windows using Delphi 2010) to get the number of
Is it possible to get the bios information of windows 7 using java, the
I'm messing around with some windows functions using p/invoke. Occasionally, I get an error
I am using cygwin to get unix environment on windows. I have some shell

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.