This is my first RMarkdown document!
Let's load the Gapminder data from http://bioconnector.org:
library(dplyr)
library(readr)
gm <- read_csv('gapminder.csv')
head(gm)
## # A tibble: 6 x 6
## country continent year lifeExp pop gdpPercap
##
## 1 Afghanistan Asia 1952 28.801 8425333 779.4453
## 2 Afghanistan Asia 1957 30.332 9240934 820.8530
## 3 Afghanistan Asia 1962 31.997 10267083 853.1007
## 4 Afghanistan Asia 1967 34.020 11537966 836.1971
## 5 Afghanistan Asia 1972 36.088 13079460 739.9811
## 6 Afghanistan Asia 1977 38.438 14880372 786.1134
The mean life expectancy is 59.4744394 years.
The years surveyed in this data include: 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007.library(ggplot2)
ggplot(gm, aes(gdpPercap, lifeExp)) +
geom_point() +
scale_x_log10() +
aes(col=continent)
sessionInfo()
## R version 3.3.1 (2016-06-21)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 10586)
##
## locale:
## [1] LC_COLLATE=English_United Kingdom.1252
## [2] LC_CTYPE=Chinese (Simplified)_China.936
## [3] LC_MONETARY=English_United Kingdom.1252
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United Kingdom.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_2.1.0 readr_1.0.0 dplyr_0.5.0
##
## loaded via a namespace (and not attached):
## [1] knitrBootstrap_1.0.0 Rcpp_0.12.6 knitr_1.14
## [4] magrittr_1.5 munsell_0.4.3 colorspace_1.2-6
## [7] R6_2.1.2 stringr_1.0.0 plyr_1.8.4
## [10] tools_3.3.1 grid_3.3.1 gtable_0.2.0
## [13] DBI_0.5 htmltools_0.3.5 yaml_2.1.13
## [16] assertthat_0.1 digest_0.6.10 tibble_1.1
## [19] formatR_1.4 mime_0.5 evaluate_0.9
## [22] rmarkdown_1.0 labeling_0.3 stringi_1.1.1
## [25] scales_0.4.0 markdown_0.7.7