KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This is puzzling me. When you run summary() on a vector of integers you don't seem to get accurate results. The numbers seem to be rounded off. I tried this on three different machines with different OS's and the results are the same. For a vector: >a <- 0:628846 >str(a) int [1:628847] 0 1 2 3 4 5 6 7 8 9 ... >summary(a) Min. 1st Qu. Median Mean 3rd Qu. Max. 0 157200 314400 314400 471600 628800 >max(a) [1] 628846 For a data.frame: > b <- data.frame(b = 0:628846) > str(b) 'data.frame': 628847 obs. of 1 variable: $ b: int 0 1 2 3 4 5 6 7 8 9 ... > summary(b) b Min. : 0 1st Qu.:157212 Median :314423 Mean :314423 3rd Qu.:471635 Max. :628846 > summary(b$b) Min. 1st Qu. Median Mean 3rd Qu. Max. 0 157200 314400 314400 471600 628800 Why are these results different?
Tags (comma-separated)
Save Edits
Cancel