├── .DS_Store ├── .gitattributes ├── 0001-Introduction.md ├── 1001-base-ploting.md ├── 1001-base-ploting_files └── figure-html │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-10-2.png │ ├── unnamed-chunk-11-1.png │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-14-1.png │ ├── unnamed-chunk-14-2.png │ ├── unnamed-chunk-15-1.png │ ├── unnamed-chunk-16-1.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-18-1.png │ ├── unnamed-chunk-18-2.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-20-1.png │ ├── unnamed-chunk-21-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-25-1.png │ ├── unnamed-chunk-26-1.png │ ├── unnamed-chunk-26-2.png │ ├── unnamed-chunk-27-1.png │ ├── unnamed-chunk-28-1.png │ ├── unnamed-chunk-29-1.png │ ├── unnamed-chunk-3-1.png │ ├── unnamed-chunk-3-2.png │ ├── unnamed-chunk-30-1.png │ ├── unnamed-chunk-31-1.png │ ├── unnamed-chunk-32-1.png │ ├── unnamed-chunk-33-1.png │ ├── unnamed-chunk-34-1.png │ ├── unnamed-chunk-35-1.png │ ├── unnamed-chunk-35-2.png │ ├── unnamed-chunk-36-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-5-1.png │ ├── unnamed-chunk-7-1.png │ ├── unnamed-chunk-7-2.png │ ├── unnamed-chunk-8-1.png │ └── unnamed-chunk-8-2.png ├── 2001-ggplot-ploting.md ├── 2001-ggplot-ploting_files └── figure-html │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-10-2.png │ ├── unnamed-chunk-11-1.png │ ├── unnamed-chunk-11-2.png │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-12-2.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-14-1.png │ ├── unnamed-chunk-14-2.png │ ├── unnamed-chunk-16-1.png │ ├── unnamed-chunk-16-2.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-17-2.png │ ├── unnamed-chunk-17-3.png │ ├── unnamed-chunk-18-1.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-20-1.png │ ├── unnamed-chunk-21-1.png │ ├── unnamed-chunk-22-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-25-1.png │ ├── unnamed-chunk-26-1.png │ ├── unnamed-chunk-28-1.png │ ├── unnamed-chunk-29-1.png │ ├── unnamed-chunk-3-1.png │ ├── unnamed-chunk-3-2.png │ ├── unnamed-chunk-30-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-5-1.png │ ├── unnamed-chunk-6-1.png │ ├── unnamed-chunk-8-1.png │ ├── unnamed-chunk-8-2.png │ ├── unnamed-chunk-8-3.png │ └── unnamed-chunk-9-1.png ├── 3001-Main-diagram-types.md ├── 3001-Main-diagram-types_files └── figure-html │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-14-1.png │ ├── unnamed-chunk-15-1.png │ ├── unnamed-chunk-16-1.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-18-1.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-2-1.png │ ├── unnamed-chunk-20-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-25-1.png │ ├── unnamed-chunk-26-1.png │ ├── unnamed-chunk-27-1.png │ ├── unnamed-chunk-28-1.png │ ├── unnamed-chunk-29-1.png │ ├── unnamed-chunk-30-1.png │ ├── unnamed-chunk-31-1.png │ ├── unnamed-chunk-32-1.png │ ├── unnamed-chunk-35-1.png │ ├── unnamed-chunk-35-2.png │ ├── unnamed-chunk-37-1.png │ ├── unnamed-chunk-41-1.png │ ├── unnamed-chunk-42-1.png │ ├── unnamed-chunk-44-1.png │ └── unnamed-chunk-9-1.png ├── 4001-other-packages.md ├── 5001-interactive-ploting.md ├── 6001-some-examples.md ├── 6001-some-examples_files └── figure-html │ ├── unnamed-chunk-1-1.png │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-11-1.png │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-16-1.png │ ├── unnamed-chunk-16-2.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-2-1.png │ ├── unnamed-chunk-22-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-25-1.png │ ├── unnamed-chunk-26-1.png │ ├── unnamed-chunk-26-2.png │ ├── unnamed-chunk-27-1.png │ ├── unnamed-chunk-28-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-5-1.png │ ├── unnamed-chunk-6-1.png │ └── unnamed-chunk-9-1.png ├── 7001-rmarkdown-base.md ├── 8001-rmarkdown-extended.md ├── 9000-appendix.md ├── 9990-references.md ├── CBook.pdf ├── CBook.tex ├── README.md ├── appendix.html ├── base-tutorial.html ├── causal.html ├── figure ├── 10.png ├── 11.png ├── 12.png ├── 13.png ├── 14.png ├── 16.png ├── 17.png ├── 18.png ├── 19.png ├── 2.png ├── 20.png ├── 22.png ├── 23.jpg ├── 24.png ├── 3.png ├── 4.png ├── 6.jpg ├── Rinstall.png ├── me.png └── vcode.jpg ├── ggplot2-plot.html ├── images ├── 38701658555592_.pic.jpg ├── 38711658555602_.pic.jpg ├── paste-020985AB.png ├── paste-09A826E7.png ├── paste-153F63DA.png ├── paste-17F40901.png ├── paste-1DBD1E6D.png ├── paste-20A9EA07.png ├── paste-224B4B25.png ├── paste-24B1DE88.png ├── paste-26331167.png ├── paste-39BF420C.png ├── paste-3AB25E87.png ├── paste-3B74BCEF.png ├── paste-3BB6003B.png ├── paste-3C23FCC2.png ├── paste-3E59C75E.png ├── paste-49E7FC6A.png ├── paste-4AB4302F.png ├── paste-5127AF6C.png ├── paste-5279D793.png ├── paste-533FDD15.png ├── paste-61B75CBE.png ├── paste-62C72EF4.png ├── paste-6EDE02D4.png ├── paste-720E8336.png ├── paste-7488C7A3.png ├── paste-7647DCE8.png ├── paste-7C36FD52.png ├── paste-8047133B.png ├── paste-80A658BA.png ├── paste-826D2A4B.png ├── paste-9D62CD2E.png ├── paste-AA57CB6A.png ├── paste-AEF2F3EB.png ├── paste-AF884A89.png ├── paste-C2B95842.png ├── paste-CAE96605.png ├── paste-D4893CD0.png ├── paste-DA97584B.png ├── paste-E2A98278.png ├── paste-E459B436.png ├── paste-E987C1F4.png └── paste-F27FC37A.png ├── index.html ├── index.md ├── interactive-ploting.html ├── libs ├── anchor-sections-1.1.0 │ ├── anchor-sections-hash.css │ ├── anchor-sections.css │ └── anchor-sections.js ├── crosstalk-1.2.0 │ ├── css │ │ └── crosstalk.min.css │ └── js │ │ └── crosstalk.min.js ├── datatables-binding-0.23 │ └── datatables.js ├── datatables-css-0.0.0 │ └── datatables-crosstalk.css ├── dt-core-1.11.3 │ ├── css │ │ ├── jquery.dataTables.extra.css │ │ └── jquery.dataTables.min.css │ └── js │ │ └── jquery.dataTables.min.js ├── gitbook-2.6.7 │ ├── css │ │ ├── fontawesome │ │ │ └── fontawesome-webfont.ttf │ │ ├── plugin-bookdown.css │ │ ├── plugin-clipboard.css │ │ ├── plugin-fontsettings.css │ │ ├── plugin-highlight.css │ │ ├── plugin-search.css │ │ ├── plugin-table.css │ │ └── style.css │ └── js │ │ ├── app.min.js │ │ ├── clipboard.min.js │ │ ├── jquery.highlight.js │ │ ├── plugin-bookdown.js │ │ ├── plugin-clipboard.js │ │ ├── plugin-fontsettings.js │ │ ├── plugin-search.js │ │ └── plugin-sharing.js ├── htmlwidgets-1.5.4 │ └── htmlwidgets.js ├── jquery-3.6.0 │ └── jquery-3.6.0.min.js ├── plotly-binding-4.10.0 │ └── plotly.js ├── plotly-htmlwidgets-css-2.5.1 │ └── plotly-htmlwidgets.css ├── plotly-main-2.5.1 │ └── plotly-latest.min.js └── typedarray-0.1 │ └── typedarray.min.js ├── main-diagram-types.html ├── other-packages.html ├── reference.html ├── rmarkdown-base.html ├── rmarkdown-extended.html ├── search_index.json ├── some-tips-alls.html └── tidyverse-tutorial.html /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /0001-Introduction.md: -------------------------------------------------------------------------------- 1 | # (PART) R 语言基础 {.unnumbered} 2 | # Base 系列{#base-tutorial} 3 | 4 | # Tidyverse 系列{#tidyverse-tutorial} 5 | -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-10-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-10-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-14-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-14-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-15-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-15-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-18-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-18-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-21-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-21-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-25-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-25-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-26-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-26-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-27-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-27-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-29-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-29-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-3-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-3-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-30-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-30-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-31-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-31-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-32-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-32-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-33-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-33-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-34-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-34-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-35-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-35-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-35-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-35-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-36-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-36-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-7-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-7-2.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-8-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-8-1.png -------------------------------------------------------------------------------- /1001-base-ploting_files/figure-html/unnamed-chunk-8-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/1001-base-ploting_files/figure-html/unnamed-chunk-8-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-10-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-10-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-11-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-11-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-12-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-12-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-14-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-14-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-16-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-16-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-17-3.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-21-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-21-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-22-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-22-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-25-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-25-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-29-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-29-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-3-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-3-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-30-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-30-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-1.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-2.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-8-3.png -------------------------------------------------------------------------------- /2001-ggplot-ploting_files/figure-html/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/2001-ggplot-ploting_files/figure-html/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-15-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-15-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-25-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-25-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-27-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-27-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-29-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-29-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-30-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-30-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-31-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-31-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-32-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-32-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-35-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-35-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-35-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-35-2.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-37-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-37-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-41-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-41-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-42-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-42-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-44-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-44-1.png -------------------------------------------------------------------------------- /3001-Main-diagram-types_files/figure-html/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/3001-Main-diagram-types_files/figure-html/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /4001-other-packages.md: -------------------------------------------------------------------------------- 1 | # 其他相关拓展包 {#other-packages} 2 | 3 | 4 | 5 | ## ggplot2 官网 109 种拓展包 6 | 7 | 该网站一共汇总了 109 种与ggplot2 包相关的[拓展包](https://exts.ggplot2.tidyverse.org/gallery/),并且在不断更新中。拓展包与 ggplot2 包可以无缝连接,网站截图如下: 8 | 9 |  10 | 11 |  12 | 13 | ## 整理的相关扩展包 14 | 15 | 小编整理了些 R 语言可视化相关的拓展包。其中大部分是来自于 ggplot2 官网拓展包,也有部分不在这范围内,但是平常使用较多的包。 16 | 17 | > 这里给出各包介绍的链接,主要发布于公众号中,也有的内容转载与其他公众号。由于各个包都在不断更新,可能内部函数、功能存在一些变化。如果有能力的读者,建议去查阅最新的官方消息。 18 | 19 | 1. [ggvis 包--数据可视化交互](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247488405&idx=1&sn=271fc88b523e738a6a1d92504dbce330&chksm=ea24ec71dd5365671bb66cbb50afdb0b00762b7581b9d3e5060a4b59021485364093f1c8b963&scene=21#wechat_redirect) 20 | 21 | 2. [ggridges 包--峰峦图详细介绍](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247488248&idx=1&sn=6b71d7adba5ea796fdfe8f49fe232d94&chksm=ea24ed1cdd53640a1e30271584458097fce82a732f9d63ce2084dc63fbae6fb028fd7f813bb7&scene=21#wechat_redirect) 22 | 23 | 3. [esquisse 包--不写代码生成 ggplot 图](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247488200&idx=1&sn=3a058480b104165118975b2d908dff72&chksm=ea24ed2cdd53643a9deb58069cd8d0e9933fc165994a2bb7a6f7d4651c7796b839fc781ec86d&scene=21#wechat_redirect) 24 | 25 | 4. [calendR 包---私人定制专属日历](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247487814&idx=1&sn=aa58149b66ce8b6d1c6210ded418c71a&chksm=ea24eea2dd5367b4a24a670b9e78d377f1506399be8dd0d0a35230407e3dc131f6b07ab3d9ca&scene=21#wechat_redirect) 26 | 27 | 5. [corrplot 包:相关性矩阵可视化](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247487625&idx=1&sn=3102c4afb0cf97904d810579af386eb6&chksm=ea24ef6ddd53667b887d11e7013589f796c8ff4f9e1e9b6e8df817ea7b223baadbc19dfbaaa5&scene=21#wechat_redirect) 28 | 29 | 6. [cowplot 包:用 R 添加水印](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247486838&idx=2&sn=21ee1c8b683e7d27373f3e1f40901428&chksm=ea24f292dd537b843db330a88161ce6f89227418f64515164615c3f63721df6464b6d91a2b1a&scene=21#wechat_redirect) 30 | 31 | 7. [flexdashboard 包:用于 R 的简单交互式仪表盘](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247486237&idx=1&sn=571544510c7e3e48a280dd4d677656e5&chksm=ea24f4f9dd537defa493c419973f75943159316765ac61093a195b83fde314dd7fffe61349cd&scene=21#wechat_redirect) 32 | 33 | 8. [gghalves 包--你五毛我五毛](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247486214&idx=1&sn=7ff5d7375c615d20cffea6329cccff37&chksm=ea24f4e2dd537df4a5ebe66a441b2fb0ee0599a05a700e1d199f729c497a68857e8031cd2e61&scene=21#wechat_redirect) 34 | 35 | 9. [用 ggpubr 包制图](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247485615&idx=1&sn=47ac21f131bf2ac6c90c50fb9fb7966b&chksm=ea24f74bdd537e5d74f60919388f683dfe779fe8a2d11999e55e290d4bdb25c64e36cc74ccc1&scene=21#wechat_redirect) 36 | 37 | 10. [reticulate 包--数据科学者的福音](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247484515&idx=1&sn=26b03b6ad26f2315cdc04049f740f1c0&chksm=ea24fb87dd537291d5184c28a9c9f2cdda591e4c17a7e7daaff34a9a1c3949ee0e86f9b355b7&scene=21#wechat_redirect) 38 | 39 | 11. [igraph 包--绘制网络图](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247483780&idx=1&sn=46ce562ed91ec2d08d7669477160c249&chksm=ea24fe60dd53777615de14ec0ad087c1bbc56d46d73eb51e13fdeeaa60633063b4bd415a7d01&scene=21#wechat_redirect) 40 | 41 | 12. [R-ggchicklet - 圆角条形图绘制](https://mp.weixin.qq.com/s/JqzHEvFfGlDSCdTWhw5uxQ) 42 | 43 | 13. [ggstatsplot包:数据可视化与统计建模相结合](https://mp.weixin.qq.com/s/3IhAxIW6nRYjyWhyepT0kQ) 44 | 45 | 14. [igraph包------绘制网络图](https://mp.weixin.qq.com/s/cq7xnbUG01k_v6WzU9Us6A) 46 | 47 | 15. [explore包------化繁为简,交互式数据探索分析](https://mp.weixin.qq.com/s/qJ7iqCt3VgCTI9erd5XzsQ) 48 | 49 | 16. [grafify包|快速绘制19个 ggplot2 图形](https://mp.weixin.qq.com/s/KZ1Zy4EYC3Ex5M38zypc3g) 50 | 51 | 17. [ggThemeAssist包:交互式修改图形主题](https://mp.weixin.qq.com/s/NvqznH9kA4E9c9qus0K-8g) 52 | -------------------------------------------------------------------------------- /5001-interactive-ploting.md: -------------------------------------------------------------------------------- 1 | # 认识交互式绘图工具{#interactive-ploting} 2 | 3 | 4 | 5 | 6 | 前面可视化的结果就是一个静态的图形,所有信息都一目了然地放在一张图上。 7 | 8 | 静态图形适合于分析报告等纸质媒介,而在网络时代,如果在网页上发布可视化,那么动态的、交互的图形则更有优势。 9 | 10 | 在R的环境中,动态交互图形的优势在于能和knitr,shiny等框架整合在一起,能迅速建立一套可视化原型系统。 11 | 12 | > 由于pdf不支持html有关的图形输出,这里只给代码,可以自行运行,查看结果。 13 | 14 | > 注意:提前安装好相应的包。 15 | 16 | htmlwidgets包,这是一个专为R语言打造的可视化JS库,只需要编写几行R语言代码便可生成交互式的可视化页面。目前已经有基于htmlwidgets制作的R包可供直接调用,具体名称及对应作用见表 17 | 18 |  19 | 20 | ## leaflet包 21 | 22 | 23 | ```r 24 | library(leaflet) 25 | leaflet()%>% 26 | addTiles()%>% 27 | addMarkers(lng=174.768,lat=-36.852,popup="ThebirthplaceofR") 28 | ``` 29 | 30 | ## dygraphs包 31 | 32 | 33 | ```r 34 | library(dygraphs) 35 | lungDeaths <- cbind(mdeaths, fdeaths) 36 | dygraph(lungDeaths) 37 | ``` 38 | 39 | ## plotly包 40 | 41 | 42 | ```r 43 | library(plotly) 44 | pal <- RColorBrewer::brewer.pal(nlevels(iris$Species), "Set1") 45 | plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length, color = ~Species, 46 | colors = pal, mode = "markers") 47 | ``` 48 | 49 | 50 | ```r 51 | p <- ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, colour = Species))+ 52 | scale_color_brewer(palette = "Set1")+ 53 | geom_point() 54 | ggplotly(p) 55 | ``` 56 | 57 | ## DT包 58 | 59 | 60 | ```r 61 | library(DT) 62 | datatable(iris) 63 | ``` 64 | 65 | ## networkD3包 66 | 67 | 68 | ```r 69 | library(networkD3) 70 | src <- c("A","A","A","A","B","B","C","C","D") 71 | target <- c("B","C","D","J","E","F","G","H","I") 72 | networkData <- data.frame(src, target) 73 | simpleNetwork(networkData, zoom = T) 74 | ``` 75 | 76 | 77 | ```r 78 | data(MisLinks) 79 | data(MisNodes) 80 | forceNetwork(Links = MisLinks, Nodes = MisNodes, Source = "source", 81 | Target = "target", Value = "value", NodeID = "name", 82 | Group = "group", opacity = 0.8) 83 | ``` 84 | 85 | ## 利用Shiny包实现可交互的Web应用 86 | 87 | shiny的官网包含了非常多的内容,包括详细教程,案例等。网站地址如下: 88 | 89 | 90 | -------------------------------------------------------------------------------- /6001-some-examples.md: -------------------------------------------------------------------------------- 1 | # 常用案例 {#some-tips-alls} 2 | 3 | 4 | 5 | ## 绘制不同分布的 QQ 图 6 | 7 | 这里主要是用 qqplotr 包进行绘制,参考的博客:[An Introduction to qqplotr](https://cran.r-project.org/web/packages/qqplotr/vignettes/introduction.html)。 8 | 9 | ### 简单版本 10 | 11 | #### 绘制正态分布的 QQ 图 12 | 13 | 14 | ```r 15 | library(qqplotr) 16 | library(ggplot2) 17 | # 随机产生数据 18 | set.seed(0) 19 | smp <- data.frame(norm = rnorm(100)) 20 | # 绘制 21 | gg <- ggplot(data = smp, mapping = aes(sample = norm)) + 22 | stat_qq_band() + 23 | stat_qq_line() + 24 | stat_qq_point() + 25 | labs(x = "Theoretical Quantiles", y = "Sample Quantiles") 26 | gg 27 | ``` 28 | 29 | 30 | 31 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-1-1} \end{center} 32 | 33 | 使用三种不同的置信带构造置信区间,其可以用参数 `bandType` 调整。 34 | 35 | 36 | ```r 37 | library(viridis) 38 | gg <- ggplot(data = smp, mapping = aes(sample = norm)) + 39 | geom_qq_band(bandType = "ks", mapping = aes(fill = "KS"), alpha = 0.9) + 40 | geom_qq_band(bandType = "ts", mapping = aes(fill = "TS"), alpha = 0.9) + 41 | geom_qq_band(bandType = "pointwise", mapping = aes(fill = "Normal"), alpha = 0.9) + 42 | geom_qq_band(bandType = "boot", mapping = aes(fill = "Bootstrap"), alpha = 0.9) + 43 | stat_qq_line() + 44 | stat_qq_point() + 45 | labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + 46 | scale_fill_viridis(discrete = T,direction = -1) 47 | 48 | gg 49 | ``` 50 | 51 | 52 | 53 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-2-1} \end{center} 54 | 55 | ### 进阶版本 56 | 57 | 读者绘制正态分布的 QQ 图,还是比较简单。但是如果是其他分布的情况呢? 58 | 59 | > 这里以一个可靠性数据为例子,该数据来源于文献:Badar, M. G., Priest, A. M. (1982). Statistical aspects of fiber and bundle strength in hybrid composites. In: Hayashi, T., Kawata, K., Umekawa, S., eds. Progress in Science and Engineering Composites. Tokyo: ICCM-IV, pp. 1129--1136。 60 | 61 | 62 | ```r 63 | data = data.frame('y' = c(1.339, 1.434, 1.549, 1.574 ,1.589, 1.613, 1.746 ,1.753, 1.764 ,1.807, 1.812, 1.84, 1.852, 1.852, 1.862, 1.864, 1.931, 1.952, 1.974, 2.019, 2.051, 2.055, 2.058 ,2.088, 2.125, 2.162, 2.171, 2.172 ,2.18 ,2.194 ,2.211 ,2.27, 2.272, 2.28, 2.299, 2.308, 2.335 ,2.349 ,2.356 ,2.386, 2.39, 2.41, 2.43, 2.431, 2.458, 2.471, 2.497, 2.514 ,2.558, 2.577, 2.593, 2.601, 2.604, 2.62 ,2.633, 2.67, 2.682, 2.699, 2.705, 2.735, 2.785, 2.785,3.02, 3.042, 3.116, 3.174)) 64 | ``` 65 | 66 | #### 绘制指数分布的 QQ 图 67 | 68 | 这里我们绘制其指数分布的 QQ 图。根据指数函数参数拟合该数据之后,得到`rate =2.2867`,并将其保存到 list 中。 69 | 70 | > 具体如何拟合,读者自行搜索 R 包中的相关函数。 71 | 72 | 其他代码基本不变,主要是将 `stat_qq_line()` 和 `stat_qq_point()` 中的分布设定下,参数设定下。 73 | 74 | 75 | ```r 76 | # exponential distribution 77 | dp <- list(rate = 2.2867) 78 | di <- "exp" 79 | p1 = ggplot(data = data, mapping = aes(sample = y)) + 80 | stat_qq_band(distribution = di, dparams = dp) + 81 | stat_qq_line(distribution = di, dparams = dp) + 82 | stat_qq_point(distribution = di, dparams = dp) + 83 | labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + 84 | theme_bw() + 85 | theme(panel.grid = element_blank()) 86 | p1 87 | ``` 88 | 89 | 90 | 91 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-4-1} \end{center} 92 | 93 | #### 绘制威布尔分布的 QQ 图 94 | 95 | 同理,将该数据应用到威布尔分布中。结果如下: 96 | 97 | 98 | ```r 99 | # weibull distribution 100 | di <- "weibull" # exponential distribution 101 | dp <- list(shape=5.4766,scale=2.4113) 102 | p2 = ggplot(data = data, mapping = aes(sample = y)) + 103 | stat_qq_band(distribution = di, dparams = dp) + 104 | stat_qq_line(distribution = di, dparams = dp) + 105 | stat_qq_point(distribution = di, dparams = dp) + 106 | labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + 107 | theme_bw() + 108 | theme(panel.grid = element_blank()) 109 | p2 110 | ``` 111 | 112 | 113 | 114 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-5-1} \end{center} 115 | 116 | 可以看到该数据集,更适合使用 weibull分布进行拟合。 117 | 118 | 119 | ```r 120 | library(cowplot) 121 | plot_grid(p1, p2, ncol = 2, nrow = 1) 122 | ``` 123 | 124 | 125 | 126 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-6-1} \end{center} 127 | 128 | ## 绘制混合密度函数图以及添加分位数线 129 | 130 | 主要使用 `ggridges` 包中的 `stat_density_ridges()`。参考的博客: 131 | 132 | ### 加载包 133 | 134 | 135 | ```r 136 | library(ggplot2) 137 | library(ggridges) 138 | ``` 139 | 140 | ### 产生数据集 141 | 142 | 假设数据来源于一个混合分布。 143 | 144 | 145 | ```r 146 | item <- 10000 147 | inds <- rbinom(1, item, 0.5) 148 | x <- c(rnorm(inds, 1, 1), rnorm(item - inds, 8, 1)) 149 | data <- data.frame("value" = x, "class" = rep(1, length(x))) 150 | ``` 151 | 152 | ### 绘制密度函数图并添加分位数线 153 | 154 | 155 | ```r 156 | # 绘图 157 | p1 <- ggplot(data, aes(x = value, y = class, fill = factor(stat(quantile)))) + 158 | stat_density_ridges( 159 | geom = "density_ridges_gradient", 160 | calc_ecdf = TRUE, 161 | quantiles = c(0.025, 0.975) 162 | ) + 163 | scale_fill_manual( 164 | name = "Probability", values = c("#E2EAF6", "#436FB0", "#E2EAF6") 165 | ) + 166 | theme_bw() + 167 | theme(legend.position = "none", panel.grid = element_blank()) + 168 | labs(x = "x", y = "Density") 169 | p1 170 | ``` 171 | 172 | 173 | 174 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-9-1} \end{center} 175 | 176 | 177 | ```r 178 | p2 <- ggplot(data, aes(x = value, y = class, fill = factor(stat(quantile)))) + 179 | stat_density_ridges( 180 | geom = "density_ridges_gradient", 181 | calc_ecdf = TRUE, 182 | quantiles = c(0.005, 0.495, 0.51, 0.99) 183 | ) + 184 | scale_fill_manual( 185 | name = "Probability", values = c("#E2EAF6", "#436FB0", "#E2EAF6", "#436FB0", "#E2EAF6"), 186 | ) + 187 | theme_bw() + 188 | theme(legend.position = "none", panel.grid = element_blank()) + 189 | labs(x = "x", y = "Density") 190 | 191 | p2 192 | ``` 193 | 194 | 195 | 196 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-10-1} \end{center} 197 | 198 | ### 合并两图(使用cowplot包) 199 | 200 | 201 | ```r 202 | library(cowplot) 203 | # pdf("plot_cow.pdf", width = 8, height = 4) 204 | plot_grid(p1, p2, ncol = 1, nrow = 2) 205 | ``` 206 | 207 | 208 | 209 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-11-1} \end{center} 210 | 211 | ```r 212 | # dev.off() 213 | ``` 214 | 215 | ## 绘制不同参数的密度函数 216 | 217 | ### Beta 密度函数 218 | 219 | 绘制不同参数下的 Beta 密度函数。具体该分布的介绍可见: 220 | 221 | Beta函数如下: $$ 222 | B(a,b) = \int_{0}^{1} x^{a-1} {(1-x)}^{b-1} dx,\quad a,b>0 223 | $$ 224 | 225 | Beta 分布: 226 | 227 | 随机变量 X 的密度函数为: 228 | 229 | $$p(x) = \frac{1}{\mathrm{~B}(\alpha, \beta)} x^{\alpha-1}(1-x)^{\beta-1}$$ 230 | 231 | > **存在问题**:还未把各个密度函数的参数加入。 232 | 233 | 234 | ```r 235 | ## Beta Distribution 236 | library(ggplot2) 237 | library(reshape2) 238 | library(ggsci) 239 | item = 1000 240 | x <- seq(0,1,length = item) 241 | beta_dist <- data.frame(cbind(x,dbeta(x,0.5,0.5), dbeta(x,2,2), dbeta(x,0.5,2),dbeta(x,2,0.5),dbeta(x,1,5),dbeta(x,5,1),dbeta(x,1,1))) 242 | colnames(beta_dist) <- c("x","a=0.5,b=0.5","a=2,b=2","a=0.5,b=2", 243 | "a=2,b=0.5","a=1,b=5","a=5,b=1","a=1,b=1") 244 | beta_dist <- melt(beta_dist,x) 245 | beta_dist$"class" = c(rep(1:3,each = 2*item),rep(4,item)) 246 | g <- ggplot(beta_dist, aes(x,value, color=variable)) 247 | g + geom_line() + 248 | facet_wrap(vars(class),scales = "free_y") + 249 | labs(title="Beta Distribution", x="x", y="Probability") + 250 | scale_color_aaas() + 251 | theme_bw() + theme(panel.grid = element_blank(),legend.position = 'none') 252 | ``` 253 | 254 | 255 | 256 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-12-1} \end{center} 257 | 258 | ## 散点图中加入第三变量的密度函数 259 | 260 | 261 | ```r 262 | ### Accept-reject algorithm 263 | ### beta(2.7,6.3) 264 | library(ggplot2) 265 | num <- 1000 266 | ys <- runif(num) 267 | us <- runif(num, 0, 2.67) 268 | xs <- dbeta(ys, 2.7, 6.3) 269 | data <- data.frame("x_rand" = ys, "Density" = us, "true_x" = xs) 270 | ggplot(data) + 271 | geom_point(aes(x_rand, Density), col = "#95E1D3") + 272 | geom_area(aes(x_rand, xs), 273 | fill = 4, alpha = 0.5, 274 | color = 1, # Line color 275 | lwd = 0.5, # Line width 276 | linetype = 1 277 | ) + 278 | annotate("text", x = 0.3, y = 0.5, label = "sum(xs>us)", size = 5) + 279 | labs(x = "x") + 280 | theme_bw() + 281 | theme(panel.grid = element_blank()) 282 | ``` 283 | 284 | 285 | 286 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-13-1} \end{center} 287 | 288 | ## 绘制 Gamma 分布相关图形 289 | 290 | - 自定义主题 291 | 292 | 293 | ```r 294 | library(ggridges) 295 | # 自定义主题 296 | theme_manual = function(){ 297 | theme(panel.grid = element_blank(), 298 | panel.border = element_blank(), 299 | axis.text = element_blank(), 300 | axis.ticks = element_blank(), 301 | legend.position="none") 302 | } 303 | ``` 304 | 305 | - 数据模拟 306 | 307 | 308 | ```r 309 | library(DT) 310 | library(ggplot2) 311 | num = 100 312 | data = data.frame('id' = 1:num,'value' = rgamma(num,2,1),'class' = factor(gl(5,num/5))) 313 | datatable(data) 314 | ``` 315 | 316 | 317 | 318 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-15-1} \end{center} 319 | 320 | - 绘图 321 | 322 | 323 | ```r 324 | p1 = ggplot(data,aes(id,value)) + 325 | geom_line() + 326 | geom_hline(yintercept = max(data$value)+0.2) + 327 | geom_hline(yintercept = min(data$value)-0.2) + 328 | theme_bw() + 329 | theme_manual() + xlab('') + ylab('') 330 | p1 331 | ``` 332 | 333 | 334 | 335 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-16-1} \end{center} 336 | 337 | ```r 338 | ## 纵向密度函数图 339 | p2 = ggplot(data, aes(x = value, y =class, fill = class)) + 340 | geom_density_ridges(aes(),alpha = 0.2,scale = 1,bandwidth = 1) + 341 | coord_flip() + 342 | # scale_point_color_hue(l = 40) + 343 | # scale_discrete_manual(aesthetics = "point_shape", values = c(21, 22, 23,24,25)) + 344 | theme_bw() + 345 | theme_manual() + xlab('') + ylab('') 346 | p2 347 | ``` 348 | 349 | 350 | 351 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-16-2} \end{center} 352 | 353 | - 合并图形 354 | 355 | 356 | ```r 357 | library(cowplot) 358 | plot_grid(p1,p2,ncol = 1) 359 | ``` 360 | 361 | 362 | 363 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-17-1} \end{center} 364 | 365 | ## 纯手动复现密度图 366 | 367 | 老板觉得课件的图形太过模糊和单调,于是想让我用 [ggplot2](https://ggplot2.tidyverse.org/) 包复现一下结果,做的更加高清、精美些。于是我花将近一个小时复现了下面这个图形: 368 | 369 |  370 | 371 | 主要有两部分构成:1. 绘制密度函数曲线并填充分位数面积;2. 添加各种线段和文字。 372 | 373 | - 数据产生 374 | 375 | 376 | ```r 377 | # 数据产生 378 | set.seed(1) 379 | mu = c(2,5) 380 | std = c(1,1) 381 | num = 1000 382 | r1 = rnorm(num,mu[1],std[1]) 383 | r2 = rnorm(num,mu[2],std[2]) 384 | data = data.frame('value' = c(r1,rep(NA,num),r2,rep(NA,5*num)), 385 | 'class' = factor(rep(c(1:8),each= num))) 386 | knitr::kable(head(data)) 387 | ``` 388 | 389 | 390 | \begin{tabular}{r|l} 391 | \hline 392 | value & class\\ 393 | \hline 394 | 1.373546 & 1\\ 395 | \hline 396 | 2.183643 & 1\\ 397 | \hline 398 | 1.164371 & 1\\ 399 | \hline 400 | 3.595281 & 1\\ 401 | \hline 402 | 2.329508 & 1\\ 403 | \hline 404 | 1.179532 & 1\\ 405 | \hline 406 | \end{tabular} 407 | 408 | - 画图 409 | 410 | 文中还是使用前面自定义的主题。 411 | 412 | 413 | ```r 414 | # 画图 415 | ggplot(data, aes(x = value, y = class,fill = factor(stat(quantile)))) + 416 | # 添加密度函数图 417 | stat_density_ridges( 418 | geom = "density_ridges_gradient", 419 | calc_ecdf = TRUE,rel_min_height = 0.02, 420 | quantiles = c(0.025, 0.975), 421 | alpha = 1,scale = 0.6,bandwidth = 1 422 | ) + 423 | scale_fill_manual( 424 | name = "Probability", values = c("#FF0000A0", "white", "#FF0000A0"), #"#0000FFA0" 425 | labels = c("(0, 0.025]", "(0.025, 0.975]", "(0.975, 1]") 426 | ) + 427 | # 添加各种线段,文字 428 | annotate("segment", x = mu[1], xend = mu[1], y = 1, yend = 7,colour = "black") + 429 | annotate("segment", x = mu[2]-1, xend = mu[2]-1, y = 1, yend = 7,colour = "#0000FFA0",lty = "dashed") + 430 | annotate("segment", x = mu[1]-2.15, xend = mu[1]-2, y = 1, yend = 7,colour = "#0000FFA0",lty = "dashed") + 431 | annotate("segment", x = mu[2], xend = mu[2], y = 3-0.02, yend = 4.18,colour = "black") + 432 | annotate("segment", x = 0, xend = 10, y = 3, yend = 3,colour = "black") + 433 | annotate("segment", x = -3, xend = 7, y = 1, yend = 1,colour = "black") + 434 | annotate("text", x = mu[1], y = 0.7, label = expression(mu[T])) + 435 | annotate("text", x = mu[1]-2.15, y = 0.7, label = expression(alpha[1])) + 436 | annotate("text", x = mu[1]+2, y = 0.7, label = expression(alpha[2])) + 437 | annotate("text", x = mu[2], y = 2.8, label = expression(mu[T])) + 438 | annotate("text", x = 0.5, y = 3.9, label = expression(beta)) + 439 | annotate(geom = "line",x = c(0.8, 3.1), 440 | y = c(3.8, 3.2), 441 | arrow = arrow(angle = 20, length = unit(4, "mm"))) + 442 | annotate("text", x = mu[1], y = 7.3, label = "CL") + 443 | annotate("text", x = mu[2]-1, y = 7.4, label = "UCL") + 444 | annotate("text", x = mu[1]-2, y = 7.4, label = "LCL") + 445 | annotate("text", x = -1.3, y = 2.3, label = expression(alpha[1] + alpha[2] == alpha)) + 446 | coord_flip() + 447 | theme_bw() + 448 | theme_manual() + xlab('') + ylab('') 449 | ``` 450 | 451 | 452 | 453 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-19-1} \end{center} 454 | 455 | 可以看到,现在得到的结果还是有点问题的。笔者能力有限,不能使用代卖复现的一模一样(也是为了省时间),于是我是用了 [AI](https://mp.weixin.qq.com/s/BkPAsH8qDZzQkcBRgMsOSw) 大法,对该图形进行了修改。最后得到: 456 | 457 |  458 | 459 | ## 绘制贝叶斯分析相关图形 460 | 461 | 主要使用 [bayesplot](https://github.com/stan-dev/bayesplot) 包进行绘制,对应的速查表网址为: 462 | 463 | 464 | ```r 465 | # 加载需要使用的包 466 | library(showtext) 467 | showtext_auto() #解决中文字体乱码问题 468 | library(bayesplot) 469 | library(rstanarm) 470 | options(mc.cores = parallel::detectCores()) 471 | library(ggplot2) 472 | library(dplyr) 473 | ``` 474 | 475 | ### 模型建模 476 | 477 | 为了展示贝叶斯图,我们将使用 `rstanarm::stan glm` 拟合线性回归,并始终使用这个模型。 478 | 479 | 480 | ```r 481 | model <- stan_glm(mpg~., data=mtcars, chains=4) 482 | posterior <- as.matrix(model) 483 | # head(posterior) 484 | ``` 485 | 486 | 展示你感兴趣参数的后验分布。 487 | 488 | 489 | ```r 490 | showtext_auto() 491 | mcmc_areas(posterior, pars = c("drat", "am", "wt"),prob = 0.8) + ggtitle("Posterior") 492 | ``` 493 | 494 | 495 | 496 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-22-1} \end{center} 497 | 498 | 使用轨迹追踪图诊断收敛性 499 | 500 | 501 | ```r 502 | mcmc_trace(posterior, pars=c("sigma", "wt")) 503 | ``` 504 | 505 | 506 | 507 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-23-1} \end{center} 508 | 509 | 使用`as.array`,可以提取每一个链的数据。这允许您查看每个链所选参数的跟踪图。 510 | 511 | 512 | ```r 513 | posterior_chains <- as.array(model) 514 | fargs <- list(ncol = 2, labeller = label_parsed) 515 | pars <- c("(Intercept)", "sigma") 516 | chains_trace <- mcmc_trace(posterior_chains, pars = pars, n_warmup = 300, facet_args = fargs) 517 | chains_trace 518 | ``` 519 | 520 | 521 | 522 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-24-1} \end{center} 523 | 524 | 配对图有助于确定是否有任何高度相关的参数。 525 | 526 | 527 | ```r 528 | posterior_chains %>% mcmc_pairs(pars = c("(Intercept)", "wt", "sigma")) 529 | ``` 530 | 531 | 532 | 533 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-25-1} \end{center} 534 | 535 | ### 后验预测检查 536 | 537 | 用后验预测密度来检查模型如何覆盖你的数据。 538 | 539 | 540 | ```r 541 | ppd <- posterior_predict(model, draws=500) 542 | ppd %>% 543 | ppc_intervals(y = mtcars$mpg, yrep = ., x = mtcars$wt, prob = 0.5) + 544 | labs(x = "Weight (1000 lbs)", y = "MPG", title = "") 545 | ``` 546 | 547 | 548 | 549 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-26-1} \end{center} 550 | 551 | ```r 552 | ppd %>% ppc_stat_grouped(y = mtcars$mpg, 553 | group = mtcars$am, 554 | stat = "median", binwidth=0.5) 555 | ``` 556 | 557 | 558 | 559 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-26-2} \end{center} 560 | 561 | ### 诊断 562 | 563 | Bayesplot 可以方便地检查 rstanarm 默认使用的NUTS采样方法的诊断。 564 | 565 | 566 | ```r 567 | mcmc_scatter(posterior, pars = c("wt", "sigma"), np = nuts_params(model$stanfit)) 568 | ``` 569 | 570 | 571 | 572 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-27-1} \end{center} 573 | 574 | 575 | ```r 576 | np <- nuts_params(model$stanfit) 577 | mcmc_nuts_energy(np, binwidth=1) + 578 | ggtitle("NUTS Energy Diagnostic") 579 | ``` 580 | 581 | 582 | 583 | \begin{center}\includegraphics{6001-some-examples_files/figure-latex/unnamed-chunk-28-1} \end{center} 584 | -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-16-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-16-2.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-22-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-22-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-25-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-25-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-26-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-26-2.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-27-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-27-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /6001-some-examples_files/figure-html/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/6001-some-examples_files/figure-html/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /8001-rmarkdown-extended.md: -------------------------------------------------------------------------------- 1 | # 其他方式的文档沟通{#rmarkdown-extended} 2 | 3 | ## Typora 4 | 5 | markdown 的轻量级编辑器,非常推荐大家用它做笔记。教程从上到下进行拓展,首先了解 Typora 的特性,然后对其中存在的问题进行解决。这里包括:设置免费图床,使得Typora中的图同步到网上;给Typora中的字体变化颜色。当然,以后也会继续拓展。 6 | 7 | [R沟通|markdown编辑器—Typora](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247491318&idx=1&sn=47128737582a34677926a9f64f03e4ed&chksm=ea24e112dd53680478ac90151554ebdde72ab122fcc84bae4da6e87e9c97b020275ecabc846c&scene=21#wechat_redirect) 8 | 9 | 10 | 11 | [R沟通 | 如何在Typora中设置免费的图床](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247492557&idx=1&sn=75024932a02364cb200873d069f79e29&chksm=ea271c29dd50953fbec48d64f7ac007893037bf2f89ecf023be5addff313eeefeb4ecae85b0b&scene=21#wechat_redirect) 12 | 13 | 14 | 15 | [R沟通|Typora字体颜色设置](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247494584&idx=1&sn=bd9537620ad7c8895a37c10ba788a97c&chksm=ea27145cdd509d4acf4bbe867e4e50c6a995f57f70626c3798dab478dbd37f4f6c2a4247a312&scene=21#wechat_redirect) 16 | 17 | ## xaringan 幻灯片 18 | 19 | 强烈推荐使用这个包制作幻灯片,难度从上往下一步步晋升。认真学了这三期基本够用。小编带你装x,做出不一样的幻灯片。建议大家先把前面的入门教程过一遍,再往后学。 20 | 21 | 22 | 23 | [R沟通|用xaringan包制作幻灯片](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247489685&idx=1&sn=aa5bccb2afe9c3882d415e4ed17c5b48&chksm=ea24e771dd536e6788cf8689009c469150998b58d4673c0453876f9c3b9854dbae385af33a2b&scene=21#wechat_redirect) 24 | 25 | [R沟通|设置xaringan主题](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247489789&idx=1&sn=94e8b76d45743e85db57a2b0ef417fcf&chksm=ea24e719dd536e0fbec0d3ed94d4104f65e219ebd86f5a45a30d2ff2084cf5b0bddfe079852f&scene=21#wechat_redirect) 26 | 27 | [R沟通|提升xaringan幻灯片的b格](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247495986&idx=1&sn=c0e47f57ddb341e581af7e96e8370e4a&chksm=ea270ed6dd5087c0c97adfad45988ae2ff53ff9519515e7fa503d9931d02f7268a572acf5a02&scene=21#wechat_redirect) 28 | 29 | ## 制作幻灯片 30 | 31 | 如果想要小编制作的 ppt 模板可以后台私聊。比起传统的 ppt,最大的优点就是能够将代码和结果直接输出到ppt中。 32 | 33 | [R沟通|制作个性化ppt!](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247488738&idx=1&sn=b0d21bfe77d3c7c65d0c8df72c1694d0&chksm=ea24eb06dd536210b1d1ed44d2dcb5214d106a787ace6b437549a450a83300e84b052c595a5b&scene=21#wechat_redirect) 34 | 35 | ## Rbeamer 36 | 37 | 学术报告可以使用它,类似于 LaTeX 中的 Beamer 模板。小编基本都是使用它做讨论班的幻灯片(数学公式,代码,结果相结合)。 38 | 39 | [R沟通|舍弃Latex,拥抱Rbeamer吧!](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247488659&idx=1&sn=738cd20bfccf8936b5d969483d4f6891&chksm=ea24eb77dd536261e9cc68eac635d66113ea2e296d3b5ed6280410771c0b956be1af64f52eee&scene=21#wechat_redirect) 40 | 41 | 42 | 43 | ## Dashboards 44 | 45 | 使用 markdown 语法构建可交互网站。非常容易入门,如果你对 shiny 一窍不通的话,建议先使用它来完成你的初步项目吧。 46 | 47 | [R文档沟通|Dashboards入门(1)](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247494178&idx=1&sn=0580de258138d112e9362613ba0eb3c6&chksm=ea2715c6dd509cd030957d168648c428b5511b39dc850b49234790b0233ceba5ddcceb176eff&scene=21#wechat_redirect) 48 | 49 | 50 | 51 | [R文档沟通|Dashboards入门(2)](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247494354&idx=1&sn=f2d9916c05c42e65b6cc75620deea8f3&chksm=ea271536dd509c20f2ef427b4dd547196a7d1338e678dda7b1484bdc832977bbfef98d04f81b&scene=21#wechat_redirect) 52 | 53 | 54 | 55 | [R文档沟通|Dashboards入门(3)](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247494929&idx=1&sn=ac860a3a73a979e52a783e971d1bdda5&chksm=ea2712f5dd509be30bad6c1ff96ddd9c826d9d7d27ef3dfc13943d6794d9450f860f76fc7f4a&scene=21#wechat_redirect) 56 | 57 | 58 | 59 | ## shiny 60 | 61 | 该系列转自于公众号《生信技能树》,论shiny教程和功力,他们更优秀,我就不在出教程啦。我也是个小白,学习者。 62 | 63 | [基于R语言的shiny网页工具开发基础系列-01](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247490208&idx=1&sn=950d5ca8a3839346441096a0dcced3ae&chksm=ea24e544dd536c52590d0fa77c366adbb841eb93364d44276fb6ad8420e607a3e946360aaf65&scene=21#wechat_redirect) 64 | 65 | 66 | 67 | [基于R语言的shiny网页工具开发基础系列-02](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247490208&idx=2&sn=cdb9fee34dc815e08a9f28ff6dade73b&chksm=ea24e544dd536c52972cc1253ab620f2d44c5078abd4d3dec7a47ce206df8436ab00449229d3&scene=21#wechat_redirect) 68 | 69 | 70 | 71 | [基于R语言的shiny网页工具开发基础系列-03](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247490208&idx=3&sn=057a8c1b09c6ed8c107833b60f4ae372&chksm=ea24e544dd536c5264741399a66937849f76874f727e69ccc558073a9ee8398d2de249e67414&scene=21#wechat_redirect) 72 | 73 | 74 | 75 | [基于R语言的shiny网页工具开发基础系列-04](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247490960&idx=1&sn=a30971248a4c2c0e1ce413523f88ef63&chksm=ea24e274dd536b62a14f33a28571209187ceb122d31a7e7b97855aec190cbe1255a13a40b264&scene=21#wechat_redirect) 76 | 77 | 78 | 79 | [基于R语言的shiny网页工具开发基础系列-05](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247490960&idx=2&sn=12f795a5c8d8abf709d23d0563c0715c&chksm=ea24e274dd536b6204bcf38c40cdae43334b3b48fbe03e2ebe1c33f4df437158f5f8c6faadc0&scene=21#wechat_redirect) 80 | 81 | 82 | 83 | [基于R语言的shiny网页工具开发基础系列-06](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247491342&idx=1&sn=24db0123fdbb08a45dae3ddf422c1426&chksm=ea24e0eadd5369fc311057f6fd74ebed034e66009476ce141f2552247d4dfe1626ac29de8626&scene=21#wechat_redirect) 84 | 85 | 86 | 87 | [基于R语言的shiny网页工具开发基础系列-07](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247491342&idx=2&sn=3623e59373731ecd0e2bfdf9be6912c7&chksm=ea24e0eadd5369fc05627cdc90bb46bcf88439d5306aaa74e925f93aaa31c2f7e37e0c61f76f&scene=21#wechat_redirect) 88 | 89 | ## blogdown 90 | 91 | 使用 blogdown 搭建私人博客。基础版本推文已经在《统计之都》发送了,可见:[手把手带你搭建个人博客](https://mp.weixin.qq.com/s/S4B5KO_lc3RZNUOqTJjPNQ)。 92 | 93 | 94 | ## 制作简历 95 | 96 | 97 | [R沟通|使用latex模板构建个人履历](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247493793&idx=1&sn=ac5653d10a318d71885e6b1ff3ed3a67&chksm=ea271745dd509e53173998508ab53dad55d4e2acb22c78afee57ea57bc9950503fdb22bc00d7&scene=21#wechat_redirect) 98 | 99 | ## bookdown 100 | 101 | 102 | [R沟通|Bookdown中文书稿写作手册](https://zll-blog.netlify.app/2021/07/bookdown_tutoral/) 103 | 104 | 105 | [R沟通|用bookdown制作图书(1)](http://mp.weixin.qq.com/s?__biz=MzI1NjUwMjQxMQ==&mid=2247492971&idx=1&sn=b342777e1f1bf1d4a85cff0f20735491&chksm=ea271a8fdd50939996772ee0a8e3bf1cb1f35b2361ef6c160011074464dc957a421e44cba1fe&scene=21#wechat_redirect) 106 | 107 | 108 | 109 | ## 小编有话说 110 | 111 | 1. 最近有空会把写过推文的教程录制成视频,并加入b站[**Rmarkdown从入门到精通**](https://www.bilibili.com/video/BV1ib4y1X7r9/)教程中。 112 | 2. 还会加入其他有关文档沟通的推文,**bookdown**,**blogdown**,**pagedown**等,以及对Rmarkdown做更加进一步的拓展。 113 | 3. 当然欢迎更多的读者提出宝贵的意见,或者有好的想法也欢迎和小编沟通交流。 114 | 115 | 116 | -------------------------------------------------------------------------------- /9000-appendix.md: -------------------------------------------------------------------------------- 1 | # 附录{#appendix} 2 | 3 | 为了方便初学者快速入门以及文稿的完整性,这里罗列了常用问题的介绍,包括:安装R和Rstudio,使用Rstudio可能遇到的问题以及如何获取帮助。 4 | 5 | **注:**该部分来源于[《数据科学中的 R 语言》](https://bookdown.org/wangminjie/R4DS/intro-R.html#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%B8%AE%E5%8A%A9)。 6 | 7 | 8 | 9 | ## 安装R和Rstudio{-} 10 | 11 | R软件是一个自由、开源软件平台,具有统计分析、可视化和编程的强大功能。你可以从这里免费下载。为了更好的使用 R 软件,我推荐大家使用RStudio这个IDE。这里有个在线教程帮助我们熟悉 R 和 RStudio。 12 | 13 | ### 安装 R{-} 14 | 15 | 我们从官方网站http://cran.r-project.org下载, 网站界面感觉有点朴素: 16 | 17 |  18 | 19 | 20 | ### 安装RStudio{-} 21 | 22 | 安装完R, 还需要安装RStudio。有同学可能要问 R 与 RStudio 是什么关系呢?打个比方吧,R 就像汽车的发动机, RStudio 就是汽车的仪表盘。但我更觉得 R 是有趣的灵魂,而 Rstudio 是好看的皮囊。 23 | 24 |  25 | 26 | 同样,我们从官方网站下载并安装,如果你是苹果系统的用户,选择苹果系统对应的rstudio版本即可。 27 | 28 | - https://www.rstudio.com/download 29 | - 选择RStudio Desktop 30 | 31 |  32 | 33 | 34 |  35 | 36 | ## 可能的问题{-} 37 | 38 | - 问题1:如果下载速度太慢,可以选择国内镜像, 39 | 40 |  41 | 42 |  43 | 44 | 然后再输入命令`install.packages("tidyverse")`,或者直接指定清华大学镜像 45 | 46 | 47 | 48 | ``` 49 | install.packages("tidyverse", repos = "http://mirrors.tuna.tsinghua.edu.cn/CRAN") 50 | ``` 51 | 52 | - 问题2:如果遇到如下报错信息 53 | 54 | 55 | 56 | ``` 57 | Warning in install.packages : 58 | unable to access index for repository http://cran.rstudio.com/src/contrib: 59 | cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES' 60 | ``` 61 | 62 | 输入下面命令后,再试试 63 | 64 | 65 | 66 | ``` 67 | options(download.file.method="libcurl") 68 | ``` 69 | 70 | 或者打开`D:\R\etc\Rprofile.site`,添加以下内容: 71 | 72 | 73 | 74 | ``` 75 | local({r <- getOption("repos") 76 | r["CRAN"] <- "http://mirrors.tuna.tsinghua.edu.cn/CRAN" 77 | options(repos=r)}) 78 | 79 | options(download.file.method="libcurl") 80 | ``` 81 | 82 | - 问题3:如果打开代码是乱码,可以试试修改如下设置 83 | 84 |  85 | 86 | - 问题4:如果每次打开Rstudio非常慢,可以在Rstudio里将这几个选项取消 87 | 88 |  89 | 90 | - 问题5:如果 Rstudio 打开是空白 91 | 92 | 很大的可能是你的电脑用户名是中文的,修改用户名再试试 93 | 94 | - 问题6:安装过程中提示,我的系统不能兼容 64 位的 Rstudio。 95 | 96 | 可能你是低版本的windows系统,建议安装旧版本的Rstudio,可以在[这里](https://rstudio.com/products/rstudio/older-versions/)找到旧版本. 97 | 98 | 更多Rstudio的使用,可参考这里[introducing-the-rstudio](https://www.pipinghotdata.com/posts/2020-09-07-introducing-the-rstudio-ide-and-r-markdown/)。 99 | 100 | ## 如何获取帮助{-} 101 | 102 | - 记住和学习所有的函数几乎是不可能的 103 | - 打开函数的帮助页面(`Rstudio`右下面板的`Help`选项卡) 104 | 105 | 106 | 107 | ``` 108 | ?sqrt 109 | ?gather 110 | ?spread 111 | ?ggplot2 112 | ?scale 113 | ?map_dfr 114 | ``` 115 | 116 | 比如: 117 | 118 |  119 | 120 | ## R 语言社区{-} 121 | 122 | R 语言社区非常友好,可以在这里找到你问题的答案 123 | 124 | - twitter: https://twitter.com/ 125 | - R-Bloggers: https://www.r-bloggers.com/ 126 | - kaggle: https://www.kaggle.com/ 127 | - stackoverflow: https://stackoverflow.com/questions/tagged/r 128 | - rstudio: https://community.rstudio.com/ 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /9990-references.md: -------------------------------------------------------------------------------- 1 | 2 | # 参考书籍{#reference} 3 | 4 | 这里书籍都有线上免费版本,可以点击**书籍名称跳转**。同时感谢**西京学院刘琦老师**对文稿提供的帮助。 5 | 6 | - [R语言基础教程——李东风](https://www.math.pku.edu.cn/teachers/lidf/docs/Rbook/html/_Rbook/graph.html) 7 | 8 | - [数据科学中的R语言——王敏杰](https://bookdown.org/wangminjie/R4DS/intro-R.html#%E5%AE%89%E8%A3%85-rstudio) 9 | 10 | - [ggplot2书](https://ggplot2-book.org/) 11 | 12 | - [ggplot2画廊](https://www.r-graph-gallery.com/ggplot2-package.html) 13 | 14 | - [R数据科学](https://r4ds.had.co.nz/) 15 | 16 | 其他有关**R语言**的书籍可在[**庄闪闪的R语言手册**](https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI1NjUwMjQxMQ==&scene=124#wechat_redirect)(**可跳转**)命令窗口输入**“R”**获取。也欢迎**关注**我的个人公众号,和我一起学R,统计和数据科学。 17 | 18 | \begin{figure} 19 | 20 | {\centering \includegraphics[width=0.45\linewidth]{figure/vcode} 21 | 22 | } 23 | 24 | \caption{个人公众号:庄闪闪的R语言手册}(\#fig:unnamed-chunk-1) 25 | \end{figure} 26 | 27 |  28 | **其他联系方式(可跳转)**: 29 | 30 | - [知乎](https://www.zhihu.com/people/zhuangshanshan) 31 | 32 | - [Github](https://github.com/liangliangzhuang "Github") 33 | 34 | - [CSDN](https://i.csdn.net/#/uc/profile "CSDN") 35 | 36 | - [b站](https://space.bilibili.com/226576305?share_medium=android&share_source=weixin&bbid=XYEE12AEF838D8A42E42282DBF81876CFC7CC&ts=1611217375878) 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /CBook.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/CBook.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [庄闪闪的可视化笔记](https://liangliangzhuang.github.io/R-tutorial/index.html)(更新中) 2 | 3 | 4 | ## 目录 5 | 6 | ### 第一部分 R 语言基础 7 | 8 | #### 1 Base 系列(待) 9 | 10 | #### 2 Tidyverse 系列(待) 11 | 12 | ### 第二部分 R 语言可视化 13 | 14 | #### 3 [使用基础包绘图](https://liangliangzhuang.github.io/R-tutorial/causal.html) 15 | 16 | 3.1 绘制基本图形 17 | 18 | 3.2 修改图形参数 19 | 20 | 3.3 绘制组合图形 21 | 22 | 3.4 保存图形 23 | 24 | #### 4 [使用 ggplot2 包绘图](https://liangliangzhuang.github.io/R-tutorial/ggplot2-plot.html) 25 | 26 | 4.1 简介 27 | 28 | 4.2 qplot 29 | 30 | 4.3 ggplot2包图形语法 31 | 32 | 4.4 几何对象 33 | 34 | 4.5 统计变换 35 | 36 | 4.6 刻度scale 37 | 38 | 4.7 坐标系 39 | 40 | 4.8 分面 41 | 42 | 4.9 标题、标注、指南、拼接 43 | 44 | 4.10 保存图片 45 | 46 | 4.11 例子 47 | 48 | #### 5 [常用图形](https://liangliangzhuang.github.io/R-tutorial/main-diagram-types.html) 49 | 50 | 5.1 散点图 51 | 52 | 5.2 气泡图 53 | 54 | 5.3 线性图 55 | 56 | 5.4 相关系数图/热力图 57 | 58 | 5.5 条形图 59 | 60 | 5.6 箱线图 61 | 62 | 5.7 小提琴图 63 | 64 | 5.8 饼图 65 | 66 | 5.9 冲积图 67 | 68 | 5.10 系谱图 69 | 70 | 5.11 哑铃图 71 | 72 | 5.12 斜率图 73 | 74 | 5.13 堆叠面积图 75 | 76 | 5.14 棒棒糖图 77 | 78 | 5.15 树状图 79 | 80 | 5.16 瀑布图 81 | 82 | 5.17 双标图 83 | 84 | 5.18 雷达图/星图/蜘蛛图 85 | 86 | 87 | #### 6 [其他相关拓展包](https://liangliangzhuang.github.io/R-tutorial/other-packages.html) 88 | 89 | 6.1 ggplot2 官网 109 种拓展包 90 | 91 | 6.2 整理的相关扩展包 92 | 93 | 94 | ### 第三部分 R 语言文档沟通 95 | 96 | #### 7 [认识交互式绘图工具](https://liangliangzhuang.github.io/R-tutorial/interactive-ploting.html) 97 | 98 | 7.1 leaflet 包 99 | 100 | 7.2 dygraphs 包 101 | 102 | 7.3 plotly 包 103 | 104 | 7.4 DT 包 105 | 106 | 7.5 networkD3 包 107 | 108 | 7.6 利用 Shiny 包实现可交互的 Web 109 | 110 | #### 8 [常用案例](https://liangliangzhuang.github.io/R-tutorial/some-tips-alls.html) 111 | 112 | 8.1绘制不同分布的 QQ 图 113 | 114 | 8.2 绘制混合密度函数图以及添加 115 | 116 | 8.3 绘制不同参数的密度函数 117 | 118 | 8.4 散点图中加入第三变量的密度 119 | 120 | 8.5 绘制 Gamma 分布相关图形 121 | 122 | 8.6 纯手动复现密度图 123 | 124 | 8.7 绘制贝叶斯分析相关图形 125 | 126 | #### 9 [R Markdown 入门教程](https://liangliangzhuang.github.io/R-tutorial/rmarkdown-base.html) 127 | 128 | 9.1 Rmarkdown 简介 129 | 130 | 9.2 Rmarkdown 流程演示 131 | 132 | 9.3 Rmarkdown 的主题格式 133 | 134 | 9.4 总结一些常用技巧 135 | 136 | #### 10 [其他方式的文档沟通](https://liangliangzhuang.github.io/R-tutorial/rmarkdown-extended.html) 137 | 138 | 10.1 Typora 139 | 140 | 10.2 xaringan 幻灯片 141 | 142 | 10.3 制作幻灯片 143 | 144 | 10.4 Rbeamer 145 | 146 | 10.5 Dashboards 147 | 148 | 10.6 shiny 149 | 150 | 10.7 blogdown 151 | 152 | 10.8 制作简历 153 | 154 | 10.9 bookdown 155 | 156 | 10.10 小编有话说 157 | 158 | #### 11 [附录](https://liangliangzhuang.github.io/R-tutorial/appendix.html) 159 | 160 | 安装 R 和 Rstudio 161 | 162 | 可能的问题 163 | 164 | 如何获取帮助 165 | 166 | R 语言社区 167 | 168 | 169 | -------------------------------------------------------------------------------- /figure/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/10.png -------------------------------------------------------------------------------- /figure/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/11.png -------------------------------------------------------------------------------- /figure/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/12.png -------------------------------------------------------------------------------- /figure/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/13.png -------------------------------------------------------------------------------- /figure/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/14.png -------------------------------------------------------------------------------- /figure/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/16.png -------------------------------------------------------------------------------- /figure/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/17.png -------------------------------------------------------------------------------- /figure/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/18.png -------------------------------------------------------------------------------- /figure/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/19.png -------------------------------------------------------------------------------- /figure/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/2.png -------------------------------------------------------------------------------- /figure/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/20.png -------------------------------------------------------------------------------- /figure/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/22.png -------------------------------------------------------------------------------- /figure/23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/23.jpg -------------------------------------------------------------------------------- /figure/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/24.png -------------------------------------------------------------------------------- /figure/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/3.png -------------------------------------------------------------------------------- /figure/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/4.png -------------------------------------------------------------------------------- /figure/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/6.jpg -------------------------------------------------------------------------------- /figure/Rinstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/Rinstall.png -------------------------------------------------------------------------------- /figure/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/me.png -------------------------------------------------------------------------------- /figure/vcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/figure/vcode.jpg -------------------------------------------------------------------------------- /images/38701658555592_.pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/38701658555592_.pic.jpg -------------------------------------------------------------------------------- /images/38711658555602_.pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/38711658555602_.pic.jpg -------------------------------------------------------------------------------- /images/paste-020985AB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-020985AB.png -------------------------------------------------------------------------------- /images/paste-09A826E7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-09A826E7.png -------------------------------------------------------------------------------- /images/paste-153F63DA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-153F63DA.png -------------------------------------------------------------------------------- /images/paste-17F40901.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-17F40901.png -------------------------------------------------------------------------------- /images/paste-1DBD1E6D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-1DBD1E6D.png -------------------------------------------------------------------------------- /images/paste-20A9EA07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-20A9EA07.png -------------------------------------------------------------------------------- /images/paste-224B4B25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-224B4B25.png -------------------------------------------------------------------------------- /images/paste-24B1DE88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-24B1DE88.png -------------------------------------------------------------------------------- /images/paste-26331167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-26331167.png -------------------------------------------------------------------------------- /images/paste-39BF420C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-39BF420C.png -------------------------------------------------------------------------------- /images/paste-3AB25E87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-3AB25E87.png -------------------------------------------------------------------------------- /images/paste-3B74BCEF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-3B74BCEF.png -------------------------------------------------------------------------------- /images/paste-3BB6003B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-3BB6003B.png -------------------------------------------------------------------------------- /images/paste-3C23FCC2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-3C23FCC2.png -------------------------------------------------------------------------------- /images/paste-3E59C75E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-3E59C75E.png -------------------------------------------------------------------------------- /images/paste-49E7FC6A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-49E7FC6A.png -------------------------------------------------------------------------------- /images/paste-4AB4302F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-4AB4302F.png -------------------------------------------------------------------------------- /images/paste-5127AF6C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-5127AF6C.png -------------------------------------------------------------------------------- /images/paste-5279D793.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-5279D793.png -------------------------------------------------------------------------------- /images/paste-533FDD15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-533FDD15.png -------------------------------------------------------------------------------- /images/paste-61B75CBE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-61B75CBE.png -------------------------------------------------------------------------------- /images/paste-62C72EF4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-62C72EF4.png -------------------------------------------------------------------------------- /images/paste-6EDE02D4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-6EDE02D4.png -------------------------------------------------------------------------------- /images/paste-720E8336.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-720E8336.png -------------------------------------------------------------------------------- /images/paste-7488C7A3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-7488C7A3.png -------------------------------------------------------------------------------- /images/paste-7647DCE8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-7647DCE8.png -------------------------------------------------------------------------------- /images/paste-7C36FD52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-7C36FD52.png -------------------------------------------------------------------------------- /images/paste-8047133B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-8047133B.png -------------------------------------------------------------------------------- /images/paste-80A658BA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-80A658BA.png -------------------------------------------------------------------------------- /images/paste-826D2A4B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-826D2A4B.png -------------------------------------------------------------------------------- /images/paste-9D62CD2E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-9D62CD2E.png -------------------------------------------------------------------------------- /images/paste-AA57CB6A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-AA57CB6A.png -------------------------------------------------------------------------------- /images/paste-AEF2F3EB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-AEF2F3EB.png -------------------------------------------------------------------------------- /images/paste-AF884A89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-AF884A89.png -------------------------------------------------------------------------------- /images/paste-C2B95842.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-C2B95842.png -------------------------------------------------------------------------------- /images/paste-CAE96605.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-CAE96605.png -------------------------------------------------------------------------------- /images/paste-D4893CD0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-D4893CD0.png -------------------------------------------------------------------------------- /images/paste-DA97584B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-DA97584B.png -------------------------------------------------------------------------------- /images/paste-E2A98278.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-E2A98278.png -------------------------------------------------------------------------------- /images/paste-E459B436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-E459B436.png -------------------------------------------------------------------------------- /images/paste-E987C1F4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-E987C1F4.png -------------------------------------------------------------------------------- /images/paste-F27FC37A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/images/paste-F27FC37A.png -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "庄闪闪的可视化手册" 3 | author: "庄闪闪" 4 | date: "22/7/2022" 5 | description: "这是用R的bookdown功能制作中文图书的模板,输出格式为bookdown::gitbook和bookdown::pdf_book." 6 | documentclass: book 7 | biblio-style: apa 8 | bibliography: [mybib.bib] 9 | link-citations: yes 10 | --- 11 | 12 | 13 | 14 | # 简介 {-} 15 | 16 | 这本电子书是《庄闪闪的可视化笔记》。主要内容来自一次市场调查大赛公益课程的教学内容。 17 | 18 | 19 | 20 | 21 | 22 | 这个文稿主要是在一次公益课上整理出来的。经过一年的时候,小编在实践中添加了一些新的内容,希望能为各位科研人提供一些参考。对应的上课视频如下:[R语言可视化教程](https://www.bilibili.com/video/BV1MA411p7VR?spm_id_from=333.999.0.0)。 23 | 24 | 笔记还会持续更新,读者可以通过我的公众号[《庄闪闪的 R 语言手册》](https://zll-blog.netlify.app/images/wechat.png)了解最新的学习笔记。 25 | 26 | 我是庄闪闪,这是我的[个人博客](https://zll-blog.netlify.app/), 27 | 如果有什么问题,可以通过以下方式联系我: 28 | 29 | [GitHub](https://github.com/liangliangzhuang)、[B 站](https://space.bilibili.com/226576305)、[知乎](https://www.zhihu.com/people/zhuangshanshan)、[CSDN](https://blog.csdn.net/qq_37379316?spm=1011.2124.3001.5343)、[小红书](https://www.xiaohongshu.com/user/profile/597fbfc15e87e755ab15dc26?xhsshare=WeixinSession&appuid=597fbfc15e87e755ab15dc26&apptime=1627016124)、[掘金](https://juejin.cn/user/1689330843128008) 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /libs/anchor-sections-1.1.0/anchor-sections-hash.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section::before {content: '#';font-size: 80%;} 3 | -------------------------------------------------------------------------------- /libs/anchor-sections-1.1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | .hasAnchor:hover a.anchor-section {visibility: visible;} 4 | ul > li > .anchor-section {display: none;} 5 | -------------------------------------------------------------------------------- /libs/anchor-sections-1.1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function () { 2 | // If section divs is used, we need to put the anchor in the child header 3 | const headers = document.querySelectorAll("div.hasAnchor.section[class*='level'] > :first-child") 4 | 5 | headers.forEach(function (x) { 6 | // Add to the header node 7 | if (!x.classList.contains('hasAnchor')) x.classList.add('hasAnchor') 8 | // Remove from the section or div created by Pandoc 9 | x.parentElement.classList.remove('hasAnchor') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /libs/crosstalk-1.2.0/css/crosstalk.min.css: -------------------------------------------------------------------------------- 1 | .container-fluid.crosstalk-bscols{margin-left:-30px;margin-right:-30px;white-space:normal}body>.container-fluid.crosstalk-bscols{margin-left:auto;margin-right:auto}.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:inline-block;padding-right:12px;vertical-align:top}@media only screen and (max-width: 480px){.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:block;padding-right:inherit}}.crosstalk-input{margin-bottom:15px}.crosstalk-input .control-label{margin-bottom:0;vertical-align:middle}.crosstalk-input input[type="checkbox"]{margin:4px 0 0;margin-top:1px;line-height:normal}.crosstalk-input .checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.crosstalk-input .checkbox>label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.crosstalk-input .checkbox input[type="checkbox"],.crosstalk-input .checkbox-inline input[type="checkbox"]{position:absolute;margin-top:2px;margin-left:-20px}.crosstalk-input .checkbox+.checkbox{margin-top:-5px}.crosstalk-input .checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.crosstalk-input .checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px} 2 | -------------------------------------------------------------------------------- /libs/crosstalk-1.2.0/js/crosstalk.min.js: -------------------------------------------------------------------------------- 1 | !function o(u,a,l){function s(n,e){if(!a[n]){if(!u[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[n]={exports:{}};u[n][0].call(i.exports,function(e){var t=u[n][1][e];return s(t||e)},i,i.exports,o,u,a,l)}return a[n].exports}for(var f="function"==typeof require&&require,e=0;e?@[\\\]^`{|}~])/g,"\\$1")+"']"),r=JSON.parse(n[0].innerText),i=e.factory(t,r);o(t).data("crosstalk-instance",i),o(t).addClass("crosstalk-input-bound")}if(t.Shiny){var e=new t.Shiny.InputBinding,u=t.jQuery;u.extend(e,{find:function(e){return u(e).find(".crosstalk-input")},initialize:function(e){var t,n;u(e).hasClass("crosstalk-input-bound")||(n=o(t=e),Object.keys(r).forEach(function(e){n.hasClass(e)&&!n.hasClass("crosstalk-input-bound")&&i(r[e],t)}))},getId:function(e){return e.id},getValue:function(e){},setValue:function(e,t){},receiveMessage:function(e,t){},subscribe:function(e,t){u(e).data("crosstalk-instance").resume()},unsubscribe:function(e){u(e).data("crosstalk-instance").suspend()}}),t.Shiny.inputBindings.register(e,"crosstalk.inputBinding")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(r,e,t){(function(e){"use strict";var t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(r("./input")),n=r("./filter");var a=e.jQuery;t.register({className:"crosstalk-input-checkboxgroup",factory:function(e,r){var i=new n.FilterHandle(r.group),o=void 0,u=a(e);return u.on("change","input[type='checkbox']",function(){var e=u.find("input[type='checkbox']:checked");if(0===e.length)o=null,i.clear();else{var t={};e.each(function(){r.map[this.value].forEach(function(e){t[e]=!0})});var n=Object.keys(t);n.sort(),o=n,i.set(n)}}),{suspend:function(){i.clear()},resume:function(){o&&i.set(o)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6}],8:[function(r,e,t){(function(e){"use strict";var t=n(r("./input")),l=n(r("./util")),s=r("./filter");function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var f=e.jQuery;t.register({className:"crosstalk-input-select",factory:function(e,n){var t=l.dataframeToD3(n.items),r={options:[{value:"",label:"(All)"}].concat(t),valueField:"value",labelField:"label",searchField:"label"},i=f(e).find("select")[0],o=f(i).selectize(r)[0].selectize,u=new s.FilterHandle(n.group),a=void 0;return o.on("change",function(){if(0===o.items.length)a=null,u.clear();else{var t={};o.items.forEach(function(e){n.map[e].forEach(function(e){t[e]=!0})});var e=Object.keys(t);e.sort(),a=e,u.set(e)}}),{suspend:function(){u.clear()},resume:function(){a&&u.set(a)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6,"./util":11}],9:[function(n,e,t){(function(e){"use strict";var d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./input")),a=n("./filter");var v=e.jQuery,p=e.strftime;function y(e,t){for(var n=e.toString();n.length.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_length select{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;padding:4px}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;margin-left:3px}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, white 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, white 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, white 0%, #dcdcdc 100%);background:-o-linear-gradient(top, white 0%, #dcdcdc 100%);background:linear-gradient(to bottom, white 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(25%, rgba(255, 255, 255, 0.9)), color-stop(75%, rgba(255, 255, 255, 0.9)), color-stop(100%, rgba(255, 255, 255, 0)));background:-webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}} 2 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liangliangzhuang/R-tutorial/df5f714cf9169b28bf08ecd4a0340ee5f380cb15/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/plugin-bookdown.css: -------------------------------------------------------------------------------- 1 | .book .book-header h1 { 2 | padding-left: 20px; 3 | padding-right: 20px; 4 | } 5 | .book .book-header.fixed { 6 | position: fixed; 7 | right: 0; 8 | top: 0; 9 | left: 0; 10 | border-bottom: 1px solid rgba(0,0,0,.07); 11 | } 12 | span.search-highlight { 13 | background-color: #ffff88; 14 | } 15 | @media (min-width: 600px) { 16 | .book.with-summary .book-header.fixed { 17 | left: 300px; 18 | } 19 | } 20 | @media (max-width: 1240px) { 21 | .book .book-body.fixed { 22 | top: 50px; 23 | } 24 | .book .book-body.fixed .body-inner { 25 | top: auto; 26 | } 27 | } 28 | @media (max-width: 600px) { 29 | .book.with-summary .book-header.fixed { 30 | left: calc(100% - 60px); 31 | min-width: 300px; 32 | } 33 | .book.with-summary .book-body { 34 | transform: none; 35 | left: calc(100% - 60px); 36 | min-width: 300px; 37 | } 38 | .book .book-body.fixed { 39 | top: 0; 40 | } 41 | } 42 | 43 | .book .book-body.fixed .body-inner { 44 | top: 50px; 45 | } 46 | .book .book-body .page-wrapper .page-inner section.normal sub, .book .book-body .page-wrapper .page-inner section.normal sup { 47 | font-size: 85%; 48 | } 49 | 50 | @media print { 51 | .book .book-summary, .book .book-body .book-header, .fa { 52 | display: none !important; 53 | } 54 | .book .book-body.fixed { 55 | left: 0px; 56 | } 57 | .book .book-body,.book .book-body .body-inner, .book.with-summary { 58 | overflow: visible !important; 59 | } 60 | } 61 | .kable_wrapper { 62 | border-spacing: 20px 0; 63 | border-collapse: separate; 64 | border: none; 65 | margin: auto; 66 | } 67 | .kable_wrapper > tbody > tr > td { 68 | vertical-align: top; 69 | } 70 | .book .book-body .page-wrapper .page-inner section.normal table tr.header { 71 | border-top-width: 2px; 72 | } 73 | .book .book-body .page-wrapper .page-inner section.normal table tr:last-child td { 74 | border-bottom-width: 2px; 75 | } 76 | .book .book-body .page-wrapper .page-inner section.normal table td, .book .book-body .page-wrapper .page-inner section.normal table th { 77 | border-left: none; 78 | border-right: none; 79 | } 80 | .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr, .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr > td { 81 | border-top: none; 82 | } 83 | .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr:last-child > td { 84 | border-bottom: none; 85 | } 86 | 87 | div.theorem, div.lemma, div.corollary, div.proposition, div.conjecture { 88 | font-style: italic; 89 | } 90 | span.theorem, span.lemma, span.corollary, span.proposition, span.conjecture { 91 | font-style: normal; 92 | } 93 | div.proof>*:last-child:after { 94 | content: "\25a2"; 95 | float: right; 96 | } 97 | .header-section-number { 98 | padding-right: .5em; 99 | } 100 | #header .multi-author { 101 | margin: 0.5em 0 -0.5em 0; 102 | } 103 | #header .date { 104 | margin-top: 1.5em; 105 | } 106 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/plugin-clipboard.css: -------------------------------------------------------------------------------- 1 | div.sourceCode { 2 | position: relative; 3 | } 4 | 5 | .copy-to-clipboard-button { 6 | position: absolute; 7 | right: 0; 8 | top: 0; 9 | visibility: hidden; 10 | } 11 | 12 | .copy-to-clipboard-button:focus { 13 | outline: 0; 14 | } 15 | 16 | div.sourceCode:hover > .copy-to-clipboard-button { 17 | visibility: visible; 18 | } 19 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/plugin-fontsettings.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Theme 1 3 | */ 4 | .color-theme-1 .dropdown-menu { 5 | background-color: #111111; 6 | border-color: #7e888b; 7 | } 8 | .color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { 9 | border-bottom: 9px solid #111111; 10 | } 11 | .color-theme-1 .dropdown-menu .buttons { 12 | border-color: #7e888b; 13 | } 14 | .color-theme-1 .dropdown-menu .button { 15 | color: #afa790; 16 | } 17 | .color-theme-1 .dropdown-menu .button:hover { 18 | color: #73553c; 19 | } 20 | /* 21 | * Theme 2 22 | */ 23 | .color-theme-2 .dropdown-menu { 24 | background-color: #2d3143; 25 | border-color: #272a3a; 26 | } 27 | .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { 28 | border-bottom: 9px solid #2d3143; 29 | } 30 | .color-theme-2 .dropdown-menu .buttons { 31 | border-color: #272a3a; 32 | } 33 | .color-theme-2 .dropdown-menu .button { 34 | color: #62677f; 35 | } 36 | .color-theme-2 .dropdown-menu .button:hover { 37 | color: #f4f4f5; 38 | } 39 | .book .book-header .font-settings .font-enlarge { 40 | line-height: 30px; 41 | font-size: 1.4em; 42 | } 43 | .book .book-header .font-settings .font-reduce { 44 | line-height: 30px; 45 | font-size: 1em; 46 | } 47 | 48 | /* sidebar transition background */ 49 | div.book.color-theme-1 { 50 | background: #f3eacb; 51 | } 52 | .book.color-theme-1 .book-body { 53 | color: #704214; 54 | background: #f3eacb; 55 | } 56 | .book.color-theme-1 .book-body .page-wrapper .page-inner section { 57 | background: #f3eacb; 58 | } 59 | 60 | /* sidebar transition background */ 61 | div.book.color-theme-2 { 62 | background: #1c1f2b; 63 | } 64 | 65 | .book.color-theme-2 .book-body { 66 | color: #bdcadb; 67 | background: #1c1f2b; 68 | } 69 | .book.color-theme-2 .book-body .page-wrapper .page-inner section { 70 | background: #1c1f2b; 71 | } 72 | .book.font-size-0 .book-body .page-inner section { 73 | font-size: 1.2rem; 74 | } 75 | .book.font-size-1 .book-body .page-inner section { 76 | font-size: 1.4rem; 77 | } 78 | .book.font-size-2 .book-body .page-inner section { 79 | font-size: 1.6rem; 80 | } 81 | .book.font-size-3 .book-body .page-inner section { 82 | font-size: 2.2rem; 83 | } 84 | .book.font-size-4 .book-body .page-inner section { 85 | font-size: 4rem; 86 | } 87 | .book.font-family-0 { 88 | font-family: Georgia, serif; 89 | } 90 | .book.font-family-1 { 91 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 92 | } 93 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { 94 | color: #704214; 95 | } 96 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { 97 | color: inherit; 98 | } 99 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 100 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, 101 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, 102 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, 103 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, 104 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 105 | color: inherit; 106 | } 107 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 108 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { 109 | border-color: inherit; 110 | } 111 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 112 | color: inherit; 113 | } 114 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { 115 | background-color: inherit; 116 | } 117 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { 118 | border-color: #c4b29f; 119 | opacity: 0.9; 120 | } 121 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, 122 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { 123 | background: #fdf6e3; 124 | color: #657b83; 125 | border-color: #f8df9c; 126 | } 127 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { 128 | background-color: inherit; 129 | } 130 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, 131 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { 132 | border-color: #f5d06c; 133 | } 134 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { 135 | color: inherit; 136 | background-color: #fdf6e3; 137 | border-color: #444444; 138 | } 139 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 140 | background-color: #fbeecb; 141 | } 142 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { 143 | color: #bdcadb; 144 | } 145 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { 146 | color: #3eb1d0; 147 | } 148 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 149 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, 150 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, 151 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, 152 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, 153 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 154 | color: #fffffa; 155 | } 156 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 157 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { 158 | border-color: #373b4e; 159 | } 160 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 161 | color: #373b4e; 162 | } 163 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { 164 | background-color: #373b4e; 165 | } 166 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { 167 | border-color: #373b4e; 168 | } 169 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, 170 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { 171 | color: #9dbed8; 172 | background: #2d3143; 173 | border-color: #2d3143; 174 | } 175 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { 176 | background-color: #282a39; 177 | } 178 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, 179 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { 180 | border-color: #3b3f54; 181 | } 182 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { 183 | color: #b6c2d2; 184 | background-color: #2d3143; 185 | border-color: #3b3f54; 186 | } 187 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 188 | background-color: #35394b; 189 | } 190 | .book.color-theme-1 .book-header { 191 | color: #afa790; 192 | background: transparent; 193 | } 194 | .book.color-theme-1 .book-header .btn { 195 | color: #afa790; 196 | } 197 | .book.color-theme-1 .book-header .btn:hover { 198 | color: #73553c; 199 | background: none; 200 | } 201 | .book.color-theme-1 .book-header h1 { 202 | color: #704214; 203 | } 204 | .book.color-theme-2 .book-header { 205 | color: #7e888b; 206 | background: transparent; 207 | } 208 | .book.color-theme-2 .book-header .btn { 209 | color: #3b3f54; 210 | } 211 | .book.color-theme-2 .book-header .btn:hover { 212 | color: #fffff5; 213 | background: none; 214 | } 215 | .book.color-theme-2 .book-header h1 { 216 | color: #bdcadb; 217 | } 218 | .book.color-theme-1 .book-body .navigation { 219 | color: #afa790; 220 | } 221 | .book.color-theme-1 .book-body .navigation:hover { 222 | color: #73553c; 223 | } 224 | .book.color-theme-2 .book-body .navigation { 225 | color: #383f52; 226 | } 227 | .book.color-theme-2 .book-body .navigation:hover { 228 | color: #fffff5; 229 | } 230 | /* 231 | * Theme 1 232 | */ 233 | .book.color-theme-1 .book-summary { 234 | color: #afa790; 235 | background: #111111; 236 | border-right: 1px solid rgba(0, 0, 0, 0.07); 237 | } 238 | .book.color-theme-1 .book-summary .book-search { 239 | background: transparent; 240 | } 241 | .book.color-theme-1 .book-summary .book-search input, 242 | .book.color-theme-1 .book-summary .book-search input:focus { 243 | border: 1px solid transparent; 244 | } 245 | .book.color-theme-1 .book-summary ul.summary li.divider { 246 | background: #7e888b; 247 | box-shadow: none; 248 | } 249 | .book.color-theme-1 .book-summary ul.summary li i.fa-check { 250 | color: #33cc33; 251 | } 252 | .book.color-theme-1 .book-summary ul.summary li.done > a { 253 | color: #877f6a; 254 | } 255 | .book.color-theme-1 .book-summary ul.summary li a, 256 | .book.color-theme-1 .book-summary ul.summary li span { 257 | color: #877f6a; 258 | background: transparent; 259 | font-weight: normal; 260 | } 261 | .book.color-theme-1 .book-summary ul.summary li.active > a, 262 | .book.color-theme-1 .book-summary ul.summary li a:hover { 263 | color: #704214; 264 | background: transparent; 265 | font-weight: normal; 266 | } 267 | /* 268 | * Theme 2 269 | */ 270 | .book.color-theme-2 .book-summary { 271 | color: #bcc1d2; 272 | background: #2d3143; 273 | border-right: none; 274 | } 275 | .book.color-theme-2 .book-summary .book-search { 276 | background: transparent; 277 | } 278 | .book.color-theme-2 .book-summary .book-search input, 279 | .book.color-theme-2 .book-summary .book-search input:focus { 280 | border: 1px solid transparent; 281 | } 282 | .book.color-theme-2 .book-summary ul.summary li.divider { 283 | background: #272a3a; 284 | box-shadow: none; 285 | } 286 | .book.color-theme-2 .book-summary ul.summary li i.fa-check { 287 | color: #33cc33; 288 | } 289 | .book.color-theme-2 .book-summary ul.summary li.done > a { 290 | color: #62687f; 291 | } 292 | .book.color-theme-2 .book-summary ul.summary li a, 293 | .book.color-theme-2 .book-summary ul.summary li span { 294 | color: #c1c6d7; 295 | background: transparent; 296 | font-weight: 600; 297 | } 298 | .book.color-theme-2 .book-summary ul.summary li.active > a, 299 | .book.color-theme-2 .book-summary ul.summary li a:hover { 300 | color: #f4f4f5; 301 | background: #252737; 302 | font-weight: 600; 303 | } 304 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/plugin-search.css: -------------------------------------------------------------------------------- 1 | .book .book-summary .book-search { 2 | padding: 6px; 3 | background: transparent; 4 | position: absolute; 5 | top: -50px; 6 | left: 0px; 7 | right: 0px; 8 | transition: top 0.5s ease; 9 | } 10 | .book .book-summary .book-search input, 11 | .book .book-summary .book-search input:focus, 12 | .book .book-summary .book-search input:hover { 13 | width: 100%; 14 | background: transparent; 15 | border: 1px solid #ccc; 16 | box-shadow: none; 17 | outline: none; 18 | line-height: 22px; 19 | padding: 7px 4px; 20 | color: inherit; 21 | box-sizing: border-box; 22 | } 23 | .book.with-search .book-summary .book-search { 24 | top: 0px; 25 | } 26 | .book.with-search .book-summary ul.summary { 27 | top: 50px; 28 | } 29 | .with-search .summary li[data-level] a[href*=".html#"] { 30 | display: none; 31 | } 32 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/css/plugin-table.css: -------------------------------------------------------------------------------- 1 | .book .book-body .page-wrapper .page-inner section.normal table{display:table;width:100%;border-collapse:collapse;border-spacing:0;overflow:auto}.book .book-body .page-wrapper .page-inner section.normal table td,.book .book-body .page-wrapper .page-inner section.normal table th{padding:6px 13px;border:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.normal table tr{background-color:#fff;border-top:1px solid #ccc}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table th{font-weight:700} 2 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/js/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.4 3 | * https://zenorocha.github.io/clipboard.js 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n indicates arrow keys):', 82 | '/: navigate to previous/next page', 83 | 's: Toggle sidebar']; 84 | if (config.search !== false) info.push('f: Toggle search input ' + 85 | '(use //Enter in the search input to navigate through search matches; ' + 86 | 'press Esc to cancel search)'); 87 | if (config.info !== false) gitbook.toolbar.createButton({ 88 | icon: 'fa fa-info', 89 | label: 'Information about the toolbar', 90 | position: 'left', 91 | onClick: function(e) { 92 | e.preventDefault(); 93 | window.alert(info.join('\n\n')); 94 | } 95 | }); 96 | 97 | // highlight the current section in TOC 98 | var href = window.location.pathname; 99 | href = href.substr(href.lastIndexOf('/') + 1); 100 | // accentuated characters need to be decoded (#819) 101 | href = decodeURIComponent(href); 102 | if (href === '') href = 'index.html'; 103 | var li = $('a[href^="' + href + location.hash + '"]').parent('li.chapter').first(); 104 | var summary = $('ul.summary'), chaps = summary.find('li.chapter'); 105 | if (li.length === 0) li = chaps.first(); 106 | li.addClass('active'); 107 | chaps.on('click', function(e) { 108 | chaps.removeClass('active'); 109 | $(this).addClass('active'); 110 | gs.set('tocScrollTop', summary.scrollTop()); 111 | }); 112 | 113 | var toc = config.toc; 114 | // collapse TOC items that are not for the current chapter 115 | if (toc && toc.collapse) (function() { 116 | var type = toc.collapse; 117 | if (type === 'none') return; 118 | if (type !== 'section' && type !== 'subsection') return; 119 | // sections under chapters 120 | var toc_sub = summary.children('li[data-level]').children('ul'); 121 | if (type === 'section') { 122 | toc_sub.hide() 123 | .parent().has(li).children('ul').show(); 124 | } else { 125 | toc_sub.children('li').children('ul').hide() 126 | .parent().has(li).children('ul').show(); 127 | } 128 | li.children('ul').show(); 129 | var toc_sub2 = toc_sub.children('li'); 130 | if (type === 'section') toc_sub2.children('ul').hide(); 131 | summary.children('li[data-level]').find('a') 132 | .on('click.bookdown', function(e) { 133 | if (href === $(this).attr('href').replace(/#.*/, '')) 134 | $(this).parent('li').children('ul').toggle(); 135 | }); 136 | })(); 137 | 138 | // add tooltips to the 's that are truncated 139 | $('a').each(function(i, el) { 140 | if (el.offsetWidth >= el.scrollWidth) return; 141 | if (typeof el.title === 'undefined') return; 142 | el.title = el.text; 143 | }); 144 | 145 | // restore TOC scroll position 146 | var pos = gs.get('tocScrollTop'); 147 | if (typeof pos !== 'undefined') summary.scrollTop(pos); 148 | 149 | // highlight the TOC item that has same text as the heading in view as scrolling 150 | if (toc && toc.scroll_highlight !== false && li.length > 0) (function() { 151 | // scroll the current TOC item into viewport 152 | var ht = $(window).height(), rect = li[0].getBoundingClientRect(); 153 | if (rect.top >= ht || rect.top <= 0 || rect.bottom <= 0) { 154 | summary.scrollTop(li[0].offsetTop); 155 | } 156 | // current chapter TOC items 157 | var items = $('a[href^="' + href + '"]').parent('li.chapter'), 158 | m = items.length; 159 | if (m === 0) { 160 | items = summary.find('li.chapter'); 161 | m = items.length; 162 | } 163 | if (m === 0) return; 164 | // all section titles on current page 165 | var hs = bookInner.find('.page-inner').find('h1,h2,h3'), n = hs.length, 166 | ts = hs.map(function(i, el) { return $(el).text(); }); 167 | if (n === 0) return; 168 | var scrollHandler = function(e) { 169 | var ht = $(window).height(); 170 | clearTimeout($.data(this, 'scrollTimer')); 171 | $.data(this, 'scrollTimer', setTimeout(function() { 172 | // find the first visible title in the viewport 173 | for (var i = 0; i < n; i++) { 174 | var rect = hs[i].getBoundingClientRect(); 175 | if (rect.top >= 0 && rect.bottom <= ht) break; 176 | } 177 | if (i === n) return; 178 | items.removeClass('active'); 179 | for (var j = 0; j < m; j++) { 180 | if (items.eq(j).children('a').first().text() === ts[i]) break; 181 | } 182 | if (j === m) j = 0; // highlight the chapter title 183 | // search bottom-up for a visible TOC item to highlight; if an item is 184 | // hidden, we check if its parent is visible, and so on 185 | while (j > 0 && items.eq(j).is(':hidden')) j--; 186 | items.eq(j).addClass('active'); 187 | }, 250)); 188 | }; 189 | bookInner.on('scroll.bookdown', scrollHandler); 190 | bookBody.on('scroll.bookdown', scrollHandler); 191 | })(); 192 | 193 | // do not refresh the page if the TOC item points to the current page 194 | $('a[href="' + href + '"]').parent('li.chapter').children('a') 195 | .on('click', function(e) { 196 | bookInner.scrollTop(0); 197 | bookBody.scrollTop(0); 198 | return false; 199 | }); 200 | 201 | var toolbar = config.toolbar; 202 | if (!toolbar || toolbar.position !== 'static') { 203 | var bookHeader = $('.book-header'); 204 | bookBody.addClass('fixed'); 205 | bookHeader.addClass('fixed') 206 | .css('background-color', bookBody.css('background-color')) 207 | .on('click.bookdown', function(e) { 208 | // the theme may have changed after user clicks the theme button 209 | bookHeader.css('background-color', bookBody.css('background-color')); 210 | }); 211 | } 212 | 213 | }); 214 | 215 | gitbook.events.bind("page.change", function(e) { 216 | // store TOC scroll position 217 | var summary = $('ul.summary'); 218 | gs.set('tocScrollTop', summary.scrollTop()); 219 | }); 220 | 221 | var bookBody = $('.book-body'), bookInner = bookBody.find('.body-inner'); 222 | var chapterTitle = function() { 223 | return bookInner.find('.page-inner').find('h1,h2').first().text(); 224 | }; 225 | var saveScrollPos = function(e) { 226 | // save scroll position before page is reloaded 227 | gs.set('bodyScrollTop', { 228 | body: bookBody.scrollTop(), 229 | inner: bookInner.scrollTop(), 230 | focused: document.hasFocus(), 231 | title: chapterTitle() 232 | }); 233 | }; 234 | $(document).on('servr:reload', saveScrollPos); 235 | 236 | // check if the page is loaded in an iframe (e.g. the RStudio preview window) 237 | var inIFrame = function() { 238 | var inIframe = true; 239 | try { inIframe = window.self !== window.top; } catch (e) {} 240 | return inIframe; 241 | }; 242 | if (inIFrame()) { 243 | $(window).on('blur unload', saveScrollPos); 244 | } 245 | 246 | $(function(e) { 247 | var pos = gs.get('bodyScrollTop'); 248 | if (pos) { 249 | if (pos.title === chapterTitle()) { 250 | if (pos.body !== 0) bookBody.scrollTop(pos.body); 251 | if (pos.inner !== 0) bookInner.scrollTop(pos.inner); 252 | } 253 | } 254 | if ((pos && pos.focused) || !inIFrame()) bookInner.find('.page-wrapper').focus(); 255 | // clear book body scroll position 256 | gs.remove('bodyScrollTop'); 257 | }); 258 | 259 | }); 260 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/js/plugin-clipboard.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "jQuery"], function(gitbook, $) { 2 | 3 | var copyButton = ''; 4 | var clipboard; 5 | 6 | gitbook.events.bind("page.change", function() { 7 | 8 | if (!ClipboardJS.isSupported()) return; 9 | 10 | // the page.change event is thrown twice: before and after the page changes 11 | if (clipboard) { 12 | // clipboard is already defined 13 | // we can deduct that we are before page changes 14 | clipboard.destroy(); // destroy the previous events listeners 15 | clipboard = undefined; // reset the clipboard object 16 | return; 17 | } 18 | 19 | $(copyButton).prependTo("div.sourceCode"); 20 | 21 | clipboard = new ClipboardJS(".copy-to-clipboard-button", { 22 | text: function(trigger) { 23 | return trigger.parentNode.textContent; 24 | } 25 | }); 26 | 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/js/plugin-fontsettings.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var fontState; 3 | 4 | var THEMES = { 5 | "white": 0, 6 | "sepia": 1, 7 | "night": 2 8 | }; 9 | 10 | var FAMILY = { 11 | "serif": 0, 12 | "sans": 1 13 | }; 14 | 15 | // Save current font settings 16 | function saveFontSettings() { 17 | gitbook.storage.set("fontState", fontState); 18 | update(); 19 | } 20 | 21 | // Increase font size 22 | function enlargeFontSize(e) { 23 | e.preventDefault(); 24 | if (fontState.size >= 4) return; 25 | 26 | fontState.size++; 27 | saveFontSettings(); 28 | }; 29 | 30 | // Decrease font size 31 | function reduceFontSize(e) { 32 | e.preventDefault(); 33 | if (fontState.size <= 0) return; 34 | 35 | fontState.size--; 36 | saveFontSettings(); 37 | }; 38 | 39 | // Change font family 40 | function changeFontFamily(index, e) { 41 | e.preventDefault(); 42 | 43 | fontState.family = index; 44 | saveFontSettings(); 45 | }; 46 | 47 | // Change type of color 48 | function changeColorTheme(index, e) { 49 | e.preventDefault(); 50 | 51 | var $book = $(".book"); 52 | 53 | if (fontState.theme !== 0) 54 | $book.removeClass("color-theme-"+fontState.theme); 55 | 56 | fontState.theme = index; 57 | if (fontState.theme !== 0) 58 | $book.addClass("color-theme-"+fontState.theme); 59 | 60 | saveFontSettings(); 61 | }; 62 | 63 | function update() { 64 | var $book = gitbook.state.$book; 65 | 66 | $(".font-settings .font-family-list li").removeClass("active"); 67 | $(".font-settings .font-family-list li:nth-child("+(fontState.family+1)+")").addClass("active"); 68 | 69 | $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); 70 | $book.addClass("font-size-"+fontState.size); 71 | $book.addClass("font-family-"+fontState.family); 72 | 73 | if(fontState.theme !== 0) { 74 | $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); 75 | $book.addClass("color-theme-"+fontState.theme); 76 | } 77 | }; 78 | 79 | function init(config) { 80 | var $bookBody, $book; 81 | 82 | //Find DOM elements. 83 | $book = gitbook.state.$book; 84 | $bookBody = $book.find(".book-body"); 85 | 86 | // Instantiate font state object 87 | fontState = gitbook.storage.get("fontState", { 88 | size: config.size || 2, 89 | family: FAMILY[config.family || "sans"], 90 | theme: THEMES[config.theme || "white"] 91 | }); 92 | 93 | update(); 94 | }; 95 | 96 | 97 | gitbook.events.bind("start", function(e, config) { 98 | var opts = config.fontsettings; 99 | if (!opts) return; 100 | 101 | // Create buttons in toolbar 102 | gitbook.toolbar.createButton({ 103 | icon: 'fa fa-font', 104 | label: 'Font Settings', 105 | className: 'font-settings', 106 | dropdown: [ 107 | [ 108 | { 109 | text: 'A', 110 | className: 'font-reduce', 111 | onClick: reduceFontSize 112 | }, 113 | { 114 | text: 'A', 115 | className: 'font-enlarge', 116 | onClick: enlargeFontSize 117 | } 118 | ], 119 | [ 120 | { 121 | text: 'Serif', 122 | onClick: _.partial(changeFontFamily, 0) 123 | }, 124 | { 125 | text: 'Sans', 126 | onClick: _.partial(changeFontFamily, 1) 127 | } 128 | ], 129 | [ 130 | { 131 | text: 'White', 132 | onClick: _.partial(changeColorTheme, 0) 133 | }, 134 | { 135 | text: 'Sepia', 136 | onClick: _.partial(changeColorTheme, 1) 137 | }, 138 | { 139 | text: 'Night', 140 | onClick: _.partial(changeColorTheme, 2) 141 | } 142 | ] 143 | ] 144 | }); 145 | 146 | 147 | // Init current settings 148 | init(opts); 149 | }); 150 | }); 151 | 152 | 153 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/js/plugin-search.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var index = null; 3 | var fuse = null; 4 | var _search = {engine: 'lunr', opts: {}}; 5 | var $searchInput, $searchLabel, $searchForm; 6 | var $highlighted = [], hi, hiOpts = { className: 'search-highlight' }; 7 | var collapse = false, toc_visible = []; 8 | 9 | function init(config) { 10 | // Instantiate search settings 11 | _search = gitbook.storage.get("search", { 12 | engine: config.search.engine || 'lunr', 13 | opts: config.search.options || {}, 14 | }); 15 | }; 16 | 17 | // Save current search settings 18 | function saveSearchSettings() { 19 | gitbook.storage.set("search", _search); 20 | } 21 | 22 | // Use a specific index 23 | function loadIndex(data) { 24 | // [Yihui] In bookdown, I use a character matrix to store the chapter 25 | // content, and the index is dynamically built on the client side. 26 | // Gitbook prebuilds the index data instead: https://github.com/GitbookIO/plugin-search 27 | // We can certainly do that via R packages V8 and jsonlite, but let's 28 | // see how slow it really is before improving it. On the other hand, 29 | // lunr cannot handle non-English text very well, e.g. the default 30 | // tokenizer cannot deal with Chinese text, so we may want to replace 31 | // lunr with a dumb simple text matching approach. 32 | if (_search.engine === 'lunr') { 33 | index = lunr(function () { 34 | this.ref('url'); 35 | this.field('title', { boost: 10 }); 36 | this.field('body'); 37 | }); 38 | data.map(function(item) { 39 | index.add({ 40 | url: item[0], 41 | title: item[1], 42 | body: item[2] 43 | }); 44 | }); 45 | return; 46 | } 47 | fuse = new Fuse(data.map((_data => { 48 | return { 49 | url: _data[0], 50 | title: _data[1], 51 | body: _data[2] 52 | }; 53 | })), Object.assign( 54 | { 55 | includeScore: true, 56 | threshold: 0.1, 57 | ignoreLocation: true, 58 | keys: ["title", "body"] 59 | }, 60 | _search.opts 61 | )); 62 | } 63 | 64 | // Fetch the search index 65 | function fetchIndex() { 66 | return $.getJSON(gitbook.state.basePath+"/search_index.json") 67 | .then(loadIndex); // [Yihui] we need to use this object later 68 | } 69 | 70 | // Search for a term and return results 71 | function search(q) { 72 | let results = []; 73 | switch (_search.engine) { 74 | case 'fuse': 75 | if (!fuse) return; 76 | results = fuse.search(q).map(function(result) { 77 | var parts = result.item.url.split('#'); 78 | return { 79 | path: parts[0], 80 | hash: parts[1] 81 | }; 82 | }); 83 | break; 84 | case 'lunr': 85 | default: 86 | if (!index) return; 87 | results = _.chain(index.search(q)).map(function(result) { 88 | var parts = result.ref.split("#"); 89 | return { 90 | path: parts[0], 91 | hash: parts[1] 92 | }; 93 | }) 94 | .value(); 95 | } 96 | 97 | // [Yihui] Highlight the search keyword on current page 98 | $highlighted = $('.page-inner') 99 | .unhighlight(hiOpts).highlight(q, hiOpts).find('span.search-highlight'); 100 | scrollToHighlighted(0); 101 | 102 | return results; 103 | } 104 | 105 | // [Yihui] Scroll the chapter body to the i-th highlighted string 106 | function scrollToHighlighted(d) { 107 | var n = $highlighted.length; 108 | hi = hi === undefined ? 0 : hi + d; 109 | // navignate to the previous/next page in the search results if reached the top/bottom 110 | var b = hi < 0; 111 | if (d !== 0 && (b || hi >= n)) { 112 | var path = currentPath(), n2 = toc_visible.length; 113 | if (n2 === 0) return; 114 | for (var i = b ? 0 : n2; (b && i < n2) || (!b && i >= 0); i += b ? 1 : -1) { 115 | if (toc_visible.eq(i).data('path') === path) break; 116 | } 117 | i += b ? -1 : 1; 118 | if (i < 0) i = n2 - 1; 119 | if (i >= n2) i = 0; 120 | var lnk = toc_visible.eq(i).find('a[href$=".html"]'); 121 | if (lnk.length) lnk[0].click(); 122 | return; 123 | } 124 | if (n === 0) return; 125 | var $p = $highlighted.eq(hi); 126 | $p[0].scrollIntoView(); 127 | $highlighted.css('background-color', ''); 128 | // an orange background color on the current item and removed later 129 | $p.css('background-color', 'orange'); 130 | setTimeout(function() { 131 | $p.css('background-color', ''); 132 | }, 2000); 133 | } 134 | 135 | function currentPath() { 136 | var href = window.location.pathname; 137 | href = href.substr(href.lastIndexOf('/') + 1); 138 | return href === '' ? 'index.html' : href; 139 | } 140 | 141 | // Create search form 142 | function createForm(value) { 143 | if ($searchForm) $searchForm.remove(); 144 | if ($searchLabel) $searchLabel.remove(); 145 | if ($searchInput) $searchInput.remove(); 146 | 147 | $searchForm = $('', { 148 | 'class': 'book-search', 149 | 'role': 'search' 150 | }); 151 | 152 | $searchLabel = $('', { 153 | 'for': 'search-box', 154 | 'aria-hidden': 'false', 155 | 'hidden': '' 156 | }); 157 | 158 | $searchInput = $('', { 159 | 'id': 'search-box', 160 | 'type': 'search', 161 | 'class': 'form-control', 162 | 'val': value, 163 | 'placeholder': 'Type to search (Enter for navigation)', 164 | 'title': 'Use Enter or the key to navigate to the next match, or the key to the previous match' 165 | }); 166 | 167 | $searchLabel.append("Type to search"); 168 | $searchLabel.appendTo($searchForm); 169 | $searchInput.appendTo($searchForm); 170 | $searchForm.prependTo(gitbook.state.$book.find('.book-summary')); 171 | } 172 | 173 | // Return true if search is open 174 | function isSearchOpen() { 175 | return gitbook.state.$book.hasClass("with-search"); 176 | } 177 | 178 | // Toggle the search 179 | function toggleSearch(_state) { 180 | if (isSearchOpen() === _state) return; 181 | if (!$searchInput) return; 182 | 183 | gitbook.state.$book.toggleClass("with-search", _state); 184 | 185 | // If search bar is open: focus input 186 | if (isSearchOpen()) { 187 | gitbook.sidebar.toggle(true); 188 | $searchInput.focus(); 189 | } else { 190 | $searchInput.blur(); 191 | $searchInput.val(""); 192 | gitbook.storage.remove("keyword"); 193 | gitbook.sidebar.filter(null); 194 | $('.page-inner').unhighlight(hiOpts); 195 | } 196 | } 197 | 198 | function sidebarFilter(results) { 199 | gitbook.sidebar.filter(_.pluck(results, "path")); 200 | toc_visible = $('ul.summary').find('li:visible'); 201 | } 202 | 203 | // Recover current search when page changed 204 | function recoverSearch() { 205 | var keyword = gitbook.storage.get("keyword", ""); 206 | 207 | createForm(keyword); 208 | 209 | if (keyword.length > 0) { 210 | if(!isSearchOpen()) { 211 | toggleSearch(true); // [Yihui] open the search box 212 | } 213 | sidebarFilter(search(keyword)); 214 | } 215 | } 216 | 217 | 218 | gitbook.events.bind("start", function(e, config) { 219 | // [Yihui] disable search 220 | if (config.search === false) return; 221 | init(config); 222 | collapse = !config.toc || config.toc.collapse === 'section' || 223 | config.toc.collapse === 'subsection'; 224 | 225 | // Pre-fetch search index and create the form 226 | fetchIndex() 227 | // [Yihui] recover search after the page is loaded 228 | .then(recoverSearch); 229 | 230 | 231 | // Type in search bar 232 | $(document).on("keyup", ".book-search input", function(e) { 233 | var key = (e.keyCode ? e.keyCode : e.which); 234 | // [Yihui] Escape -> close search box; Up/Down/Enter: previous/next highlighted 235 | if (key == 27) { 236 | e.preventDefault(); 237 | toggleSearch(false); 238 | } else if (key == 38) { 239 | scrollToHighlighted(-1); 240 | } else if (key == 40 || key == 13) { 241 | scrollToHighlighted(1); 242 | } 243 | }).on("input", ".book-search input", function(e) { 244 | var q = $(this).val().trim(); 245 | if (q.length === 0) { 246 | gitbook.sidebar.filter(null); 247 | gitbook.storage.remove("keyword"); 248 | $('.page-inner').unhighlight(hiOpts); 249 | } else { 250 | var results = search(q); 251 | sidebarFilter(results); 252 | gitbook.storage.set("keyword", q); 253 | } 254 | }); 255 | 256 | // Create the toggle search button 257 | gitbook.toolbar.createButton({ 258 | icon: 'fa fa-search', 259 | label: 'Search', 260 | position: 'left', 261 | onClick: toggleSearch 262 | }); 263 | 264 | // Bind keyboard to toggle search 265 | gitbook.keyboard.bind(['f'], toggleSearch); 266 | }); 267 | 268 | // [Yihui] do not try to recover search; always start fresh 269 | // gitbook.events.bind("page.change", recoverSearch); 270 | }); 271 | -------------------------------------------------------------------------------- /libs/gitbook-2.6.7/js/plugin-sharing.js: -------------------------------------------------------------------------------- 1 | gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var SITES = { 3 | 'github': { 4 | 'label': 'Github', 5 | 'icon': 'fa fa-github', 6 | 'onClick': function(e) { 7 | e.preventDefault(); 8 | var repo = $('meta[name="github-repo"]').attr('content'); 9 | if (typeof repo === 'undefined') throw("Github repo not defined"); 10 | window.open("https://github.com/"+repo); 11 | } 12 | }, 13 | 'facebook': { 14 | 'label': 'Facebook', 15 | 'icon': 'fa fa-facebook', 16 | 'onClick': function(e) { 17 | e.preventDefault(); 18 | window.open("http://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href)); 19 | } 20 | }, 21 | 'twitter': { 22 | 'label': 'Twitter', 23 | 'icon': 'fa fa-twitter', 24 | 'onClick': function(e) { 25 | e.preventDefault(); 26 | window.open("http://twitter.com/intent/tweet?text="+encodeURIComponent(document.title)+"&url="+encodeURIComponent(location.href)+"&hashtags=rmarkdown,bookdown"); 27 | } 28 | }, 29 | 'linkedin': { 30 | 'label': 'LinkedIn', 31 | 'icon': 'fa fa-linkedin', 32 | 'onClick': function(e) { 33 | e.preventDefault(); 34 | window.open("https://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title)); 35 | } 36 | }, 37 | 'weibo': { 38 | 'label': 'Weibo', 39 | 'icon': 'fa fa-weibo', 40 | 'onClick': function(e) { 41 | e.preventDefault(); 42 | window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title)); 43 | } 44 | }, 45 | 'instapaper': { 46 | 'label': 'Instapaper', 47 | 'icon': 'fa fa-italic', 48 | 'onClick': function(e) { 49 | e.preventDefault(); 50 | window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href)); 51 | } 52 | }, 53 | 'vk': { 54 | 'label': 'VK', 55 | 'icon': 'fa fa-vk', 56 | 'onClick': function(e) { 57 | e.preventDefault(); 58 | window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href)); 59 | } 60 | }, 61 | 'whatsapp': { 62 | 'label': 'Whatsapp', 63 | 'icon': 'fa fa-whatsapp', 64 | 'onClick': function(e) { 65 | e.preventDefault(); 66 | var url = encodeURIComponent(location.href); 67 | window.open((isMobile() ? "whatsapp://send" : "https://web.whatsapp.com/send") + "?text=" + url); 68 | } 69 | }, 70 | }; 71 | 72 | function isMobile() { 73 | return !!navigator.maxTouchPoints; 74 | } 75 | 76 | gitbook.events.bind("start", function(e, config) { 77 | var opts = config.sharing; 78 | if (!opts) return; 79 | 80 | // Create dropdown menu 81 | var menu = _.chain(opts.all) 82 | .map(function(id) { 83 | var site = SITES[id]; 84 | if (!site) return; 85 | return { 86 | text: site.label, 87 | onClick: site.onClick 88 | }; 89 | }) 90 | .compact() 91 | .value(); 92 | 93 | // Create main button with dropdown 94 | if (menu.length > 0) { 95 | gitbook.toolbar.createButton({ 96 | icon: 'fa fa-share-alt', 97 | label: 'Share', 98 | position: 'right', 99 | dropdown: [menu] 100 | }); 101 | } 102 | 103 | // Direct actions to share 104 | _.each(SITES, function(site, sideId) { 105 | if (!opts[sideId]) return; 106 | 107 | gitbook.toolbar.createButton({ 108 | icon: site.icon, 109 | label: site.label, 110 | title: site.label, 111 | position: 'right', 112 | onClick: site.onClick 113 | }); 114 | }); 115 | }); 116 | }); 117 | -------------------------------------------------------------------------------- /libs/plotly-htmlwidgets-css-2.5.1/plotly-htmlwidgets.css: -------------------------------------------------------------------------------- 1 | /* 2 | just here so that plotly works 3 | correctly with ioslides. 4 | see https://github.com/ropensci/plotly/issues/463 5 | */ 6 | 7 | slide:not(.current) .plotly.html-widget{ 8 | display: none; 9 | } 10 | -------------------------------------------------------------------------------- /libs/typedarray-0.1/typedarray.min.js: -------------------------------------------------------------------------------- 1 | (function(global){"use strict";var undefined=void 0;var MAX_ARRAY_LENGTH=1e5;function Type(v){switch(typeof v){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return v===null?"null":"object"}}function Class(v){return Object.prototype.toString.call(v).replace(/^\[object *|\]$/g,"")}function IsCallable(o){return typeof o==="function"}function ToObject(v){if(v===null||v===undefined)throw TypeError();return Object(v)}function ToInt32(v){return v>>0}function ToUint32(v){return v>>>0}var LN2=Math.LN2,abs=Math.abs,floor=Math.floor,log=Math.log,max=Math.max,min=Math.min,pow=Math.pow,round=Math.round;(function(){var orig=Object.defineProperty;var dom_only=!function(){try{return Object.defineProperty({},"x",{})}catch(_){return false}}();if(!orig||dom_only){Object.defineProperty=function(o,prop,desc){if(orig)try{return orig(o,prop,desc)}catch(_){}if(o!==Object(o))throw TypeError("Object.defineProperty called on non-object");if(Object.prototype.__defineGetter__&&"get"in desc)Object.prototype.__defineGetter__.call(o,prop,desc.get);if(Object.prototype.__defineSetter__&&"set"in desc)Object.prototype.__defineSetter__.call(o,prop,desc.set);if("value"in desc)o[prop]=desc.value;return o}}})();function makeArrayAccessors(obj){if(obj.length>MAX_ARRAY_LENGTH)throw RangeError("Array too large for polyfill");function makeArrayAccessor(index){Object.defineProperty(obj,index,{get:function(){return obj._getter(index)},set:function(v){obj._setter(index,v)},enumerable:true,configurable:false})}var i;for(i=0;i>s}function as_unsigned(value,bits){var s=32-bits;return value<>>s}function packI8(n){return[n&255]}function unpackI8(bytes){return as_signed(bytes[0],8)}function packU8(n){return[n&255]}function unpackU8(bytes){return as_unsigned(bytes[0],8)}function packU8Clamped(n){n=round(Number(n));return[n<0?0:n>255?255:n&255]}function packI16(n){return[n>>8&255,n&255]}function unpackI16(bytes){return as_signed(bytes[0]<<8|bytes[1],16)}function packU16(n){return[n>>8&255,n&255]}function unpackU16(bytes){return as_unsigned(bytes[0]<<8|bytes[1],16)}function packI32(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function unpackI32(bytes){return as_signed(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packU32(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]}function unpackU32(bytes){return as_unsigned(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packIEEE754(v,ebits,fbits){var bias=(1<.5)return w+1;return w%2?w+1:w}if(v!==v){e=(1<=pow(2,1-bias)){e=min(floor(log(v)/LN2),1023);f=roundToEven(v/pow(2,e)*pow(2,fbits));if(f/pow(2,fbits)>=2){e=e+1;f=1}if(e>bias){e=(1<>1}}bits.reverse();str=bits.join("");bias=(1<0){return s*pow(2,e-bias)*(1+f/pow(2,fbits))}else if(f!==0){return s*pow(2,-(bias-1))*(f/pow(2,fbits))}else{return s<0?-0:0}}function unpackF64(b){return unpackIEEE754(b,11,52)}function packF64(v){return packIEEE754(v,11,52)}function unpackF32(b){return unpackIEEE754(b,8,23)}function packF32(v){return packIEEE754(v,8,23)}(function(){function ArrayBuffer(length){length=ToInt32(length);if(length<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:length});Object.defineProperty(this,"_bytes",{value:Array(length)});for(var i=0;i=1&&Type(arguments[0])==="object"&&arguments[0]instanceof $TypedArray$){return function(typedArray){if(this.constructor!==typedArray.constructor)throw TypeError();var byteLength=typedArray.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new ArrayBuffer(byteLength)});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:0});Object.defineProperty(this,"length",{value:typedArray.length});for(var i=0;i=1&&Type(arguments[0])==="object"&&!(arguments[0]instanceof $TypedArray$)&&!(arguments[0]instanceof ArrayBuffer||Class(arguments[0])==="ArrayBuffer")){return function(array){var byteLength=array.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new ArrayBuffer(byteLength)});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:0});Object.defineProperty(this,"length",{value:array.length});for(var i=0;i=1&&Type(arguments[0])==="object"&&(arguments[0]instanceof ArrayBuffer||Class(arguments[0])==="ArrayBuffer")){return function(buffer,byteOffset,length){byteOffset=ToUint32(byteOffset);if(byteOffset>buffer.byteLength)throw RangeError("byteOffset out of range");if(byteOffset%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(length===undefined){var byteLength=buffer.byteLength-byteOffset;if(byteLength%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");length=byteLength/this.BYTES_PER_ELEMENT}else{length=ToUint32(length);byteLength=length*this.BYTES_PER_ELEMENT}if(byteOffset+byteLength>buffer.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:buffer});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:byteOffset});Object.defineProperty(this,"length",{value:length})}.apply(this,arguments)}throw TypeError()}Object.defineProperty($TypedArray$,"from",{value:function(iterable){return new this(iterable)}});Object.defineProperty($TypedArray$,"of",{value:function(){return new this(arguments)}});var $TypedArrayPrototype$={};$TypedArray$.prototype=$TypedArrayPrototype$;Object.defineProperty($TypedArray$.prototype,"_getter",{value:function(index){if(arguments.length<1)throw SyntaxError("Not enough arguments");index=ToUint32(index);if(index>=this.length)return undefined;var bytes=[],i,o;for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i=this.length)return;var bytes=this._pack(value),i,o;for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i0){o._setter(to,o._getter(from));from=from+direction;to=to+direction;count=count-1}return o}});Object.defineProperty($TypedArray$.prototype,"every",{value:function(callbackfn){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);if(!IsCallable(callbackfn))throw TypeError();var thisArg=arguments[1];for(var i=0;i1?arguments[1]:undefined;var k=0;while(k1?arguments[1]:undefined;var k=0;while(k0){n=Number(arguments[1]);if(n!==n){n=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*floor(abs(n))}}if(n>=len)return-1;var k=n>=0?n:max(len-abs(n),0);for(;k1){n=Number(arguments[1]);if(n!==n){n=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*floor(abs(n))}}var k=n>=0?min(n,len-1):len-abs(n);for(;k>=0;k--){if(t._getter(k)===searchElement)return k}return-1}});Object.defineProperty($TypedArray$.prototype,"map",{value:function(callbackfn){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);if(!IsCallable(callbackfn))throw TypeError();var res=[];res.length=len;var thisp=arguments[1];for(var i=0;i=2){accumulator=arguments[1]}else{accumulator=t._getter(k++)}while(k=2){accumulator=arguments[1]}else{accumulator=t._getter(k--)}while(k>=0){accumulator=callbackfn.call(undefined,accumulator,t._getter(k),k,t);k--}return accumulator}});Object.defineProperty($TypedArray$.prototype,"reverse",{value:function(){if(this===undefined||this===null)throw TypeError();var t=Object(this);var len=ToUint32(t.length);var half=floor(len/2);for(var i=0,j=len-1;ithis.length){throw RangeError("Offset plus length of array is out of range")}byteOffset=this.byteOffset+offset*this.BYTES_PER_ELEMENT;byteLength=array.length*this.BYTES_PER_ELEMENT;if(array.buffer===this.buffer){tmp=[];for(i=0,s=array.byteOffset;ithis.length){throw RangeError("Offset plus length of array is out of range")}for(i=0;imax?max:v}start=ToInt32(start);end=ToInt32(end);if(arguments.length<1){start=0}if(arguments.length<2){end=this.length}if(start<0){start=this.length+start}if(end<0){end=this.length+end}start=clamp(start,0,this.length);end=clamp(end,0,this.length);var len=end-start;if(len<0){len=0}return new this.constructor(this.buffer,this.byteOffset+start*this.BYTES_PER_ELEMENT,len)}});function makeTypedArray(elementSize,pack,unpack){var TypedArray=function(){Object.defineProperty(this,"constructor",{value:TypedArray});$TypedArray$.apply(this,arguments);makeArrayAccessors(this)};if("__proto__"in TypedArray){TypedArray.__proto__=$TypedArray$}else{TypedArray.from=$TypedArray$.from;TypedArray.of=$TypedArray$.of}TypedArray.BYTES_PER_ELEMENT=elementSize;var TypedArrayPrototype=function(){};TypedArrayPrototype.prototype=$TypedArrayPrototype$;TypedArray.prototype=new TypedArrayPrototype;Object.defineProperty(TypedArray.prototype,"BYTES_PER_ELEMENT",{value:elementSize});Object.defineProperty(TypedArray.prototype,"_pack",{value:pack});Object.defineProperty(TypedArray.prototype,"_unpack",{value:unpack});return TypedArray}var Int8Array=makeTypedArray(1,packI8,unpackI8);var Uint8Array=makeTypedArray(1,packU8,unpackU8);var Uint8ClampedArray=makeTypedArray(1,packU8Clamped,unpackU8);var Int16Array=makeTypedArray(2,packI16,unpackI16);var Uint16Array=makeTypedArray(2,packU16,unpackU16);var Int32Array=makeTypedArray(4,packI32,unpackI32);var Uint32Array=makeTypedArray(4,packU32,unpackU32);var Float32Array=makeTypedArray(4,packF32,unpackF32);var Float64Array=makeTypedArray(8,packF64,unpackF64);global.Int8Array=global.Int8Array||Int8Array;global.Uint8Array=global.Uint8Array||Uint8Array;global.Uint8ClampedArray=global.Uint8ClampedArray||Uint8ClampedArray;global.Int16Array=global.Int16Array||Int16Array;global.Uint16Array=global.Uint16Array||Uint16Array;global.Int32Array=global.Int32Array||Int32Array;global.Uint32Array=global.Uint32Array||Uint32Array;global.Float32Array=global.Float32Array||Float32Array;global.Float64Array=global.Float64Array||Float64Array})();(function(){function r(array,index){return IsCallable(array.get)?array.get(index):array[index]}var IS_BIG_ENDIAN=function(){var u16array=new Uint16Array([4660]),u8array=new Uint8Array(u16array.buffer);return r(u8array,0)===18}();function DataView(buffer,byteOffset,byteLength){if(!(buffer instanceof ArrayBuffer||Class(buffer)==="ArrayBuffer"))throw TypeError();byteOffset=ToUint32(byteOffset);if(byteOffset>buffer.byteLength)throw RangeError("byteOffset out of range");if(byteLength===undefined)byteLength=buffer.byteLength-byteOffset;else byteLength=ToUint32(byteLength);if(byteOffset+byteLength>buffer.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:buffer});Object.defineProperty(this,"byteLength",{value:byteLength});Object.defineProperty(this,"byteOffset",{value:byteOffset})}function makeGetter(arrayType){return function GetViewValue(byteOffset,littleEndian){byteOffset=ToUint32(byteOffset);if(byteOffset+arrayType.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");byteOffset+=this.byteOffset;var uint8Array=new Uint8Array(this.buffer,byteOffset,arrayType.BYTES_PER_ELEMENT),bytes=[];for(var i=0;ithis.byteLength)throw RangeError("Array index out of range");var typeArray=new arrayType([value]),byteArray=new Uint8Array(typeArray.buffer),bytes=[],i,byteView;for(i=0;i