If I run the following code, I get unexpected results. I don't understand why summary() results do not agree with min(), max() and other functions. There are no missing data.
Any help would be appreciated.
years <- c(2005, 2006,
rep(2007, 9), rep(2008, 9), rep(2010, 17), rep(2011, 14),
rep(2012, 16), rep(2013, 12), rep(2014, 6), rep(2015, 6))
base::summary(years)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2000 2010 2010 2010 2010 2020
quantile(years)
0% 25% 50% 75% 100%
2005 2010 2011 2013 2015
min(years)
[1] 2005
max(years)
[1] 2015
median(years)
[1] 2011
sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base