Barry
Barry

Reputation: 739

Can the decimal be increased for values come from summary?

The mean of all data I have is 0.2.I want to have more decimals otherwise it is meaningless if I want to compare between two files. Example

   summary(f)
 Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
 0.0     0.1     0.2     0.2     0.2     0.7  824982

so the mean here can be 0.29 or 0.21.Any idea on how to know this?

Upvotes: 1

Views: 167

Answers (2)

juba
juba

Reputation: 49063

You can use the digits argument :

R> summary(rnorm(10))
#    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
# -1.5520 -0.1925  0.2027  0.1862  0.8423  1.5470 
R> summary(rnorm(10),digits=10)
#       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
# -2.2444487 -1.2681605  0.1552090 -0.2980934  0.4828649  1.3489778 

Upvotes: 7

GSee
GSee

Reputation: 49820

Try

options(digits=10)
summary(f)

From ?options

‘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.

Note that the number of digits that is printed is different than the number of digits that is stored internally.

Upvotes: 5

Related Questions