From 2a957c2667ca7c923228a4052b2489bc8f601246 Mon Sep 17 00:00:00 2001 From: Xiangyun Huang Date: Tue, 21 May 2024 10:31:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=80=A7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20Fix=20#113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Render-Book.yaml | 65 +- .gitignore | 2 +- DESCRIPTION | 7 +- MSG-packages.bib | 274 +++++ README.md | 19 +- _output.yml | 2 +- data.Rmd | 30 +- foreword.Rmd | 2 +- index.Rmd | 112 +- msg.Rmd | 2 +- principle.Rmd | 3 +- renv.lock | 1735 ---------------------------- system.Rmd | 2 +- 13 files changed, 337 insertions(+), 1918 deletions(-) create mode 100644 MSG-packages.bib delete mode 100644 renv.lock diff --git a/.github/workflows/Render-Book.yaml b/.github/workflows/Render-Book.yaml index c054f2a..e56dc0e 100644 --- a/.github/workflows/Render-Book.yaml +++ b/.github/workflows/Render-Book.yaml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: config: - - {os: macos-12, r: '4.1.0'} + - {os: macos-14, r: '4.4.0'} env: LANG: "en_US.UTF-8" @@ -36,39 +36,21 @@ jobs: - name: Setup R uses: r-lib/actions/setup-r@v2 with: + use-public-rspm: true r-version: ${{ matrix.config.r }} + - uses: r-lib/actions/setup-r-dependencies@v2 + - name: Install Pandoc uses: r-lib/actions/setup-pandoc@v2 with: - pandoc-version: '2.19.2' + pandoc-version: '3.1.11' - name: Install ghostscript and Others run: | brew install poppler xquartz optipng graphviz brew tap homebrew/cask-fonts - brew install font-inconsolata font-dejavu - - - name: Cache R packages - uses: actions/cache@v3 - with: - path: ${{ env.R_LIBS_USER }} - key: r-${{ matrix.config.os }}-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }} - restore-keys: r-${{ matrix.config.os }}-${{ matrix.config.r }}- - - - name: Cache bookdown results - uses: actions/cache@v3 - with: - path: _bookdown_files - key: bookdown-${{ matrix.config.os }}-${{ matrix.config.r }}-${{ hashFiles('**/*Rmd') }} - restore-keys: bookdown-${{ matrix.config.os }}-${{ matrix.config.r }}- - - - name: Configure R CXXFLAGS - run: | - mkdir -p ~/.R - echo "CXXFLAGS += -Wno-ignored-attributes" >> ~/.R/Makevars - cat ~/.Rprofile - cat ~/.R/Makevars + brew install font-inconsolata font-dejavu - name: Install TinyTeX uses: r-lib/actions/setup-tinytex@v2 @@ -76,12 +58,6 @@ jobs: # install full prebuilt version TINYTEX_INSTALLER: TinyTeX - - name: Install R packages - run: | - if(!require('renv')) install.packages('renv') - renv::restore() - shell: Rscript {0} - - name: Install LaTeX Packages run: | tinytex::tlmgr_install(readLines("texlive.txt")) @@ -94,11 +70,11 @@ jobs: font_install(source_han_sans(), quiet = TRUE) shell: Rscript {0} - # - name: Add Fonts - # run: | - # curl -fLo Adobe-Fonts.zip https://github.com/XiangyunHuang/fonts/releases/download/v0.1/Adobe-Fonts.zip - # unzip Adobe-Fonts.zip -d ~/Library/Fonts/adobe - # fc-cache -fsv + - name: Add Fonts + run: | + curl -fLo Adobe-Fonts.zip https://github.com/XiangyunHuang/fonts/releases/download/v0.1/Adobe-Fonts.zip + unzip Adobe-Fonts.zip -d ~/Library/Fonts/adobe + fc-cache -fsv - name: Test Pkgs run: | @@ -112,7 +88,7 @@ jobs: - name: Render Book id: render-book run: | - bookdown::render_book("index.Rmd", "all") + bookdown::render_book("index.Rmd") shell: Rscript {0} - name: Cp Graphics @@ -145,20 +121,3 @@ jobs: - name: Deploy to Github Pages if: ${{ github.ref == 'refs/heads/master' }} run: ./_deploy.sh - - - name: Deploy to Netlify - if: contains(env.isExtPR, 'false') - id: netlify-deploy - uses: nwtgck/actions-netlify@v2 - with: - publish-dir: './_book' - production-branch: master - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: - 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' - enable-pull-request-comment: true - enable-commit-comment: true - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - timeout-minutes: 10 diff --git a/.gitignore b/.gitignore index e40ecdf..d24678c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ _main.rds *.log rsconnect packages.bib -MSG-packages.bib + .project _book/ _bookdown_files/ diff --git a/DESCRIPTION b/DESCRIPTION index fceed74..0182f6b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: placeholder Type: Book Title: placeholder. -Version: 0.0.0.9999 +Version: 1.0.0 Depends: R (>= 4.1.0) Imports: alphahull, @@ -11,6 +11,7 @@ Imports: bookdown, corrplot, cowplot, + car, formatR, fun, GGally, @@ -23,7 +24,6 @@ Imports: leaflet, magick, maps, - maptools, MSG, mvtnorm, pdftools, @@ -33,7 +33,6 @@ Imports: quantreg, randomForest, raster, - rgeos, rgl, RgoogleMaps, scatterplot3d, @@ -49,4 +48,4 @@ Imports: tuneR, vcd, vioplot -BugReports: https://github.com/XiangyunHuang/MSG-Book/issues +BugReports: https://github.com/XiangyunHuang/msg/issues diff --git a/MSG-packages.bib b/MSG-packages.bib new file mode 100644 index 0000000..a493be5 --- /dev/null +++ b/MSG-packages.bib @@ -0,0 +1,274 @@ +@Manual{alphahull, + title = {alphahull: Generalization of the Convex Hull of a Sample of Points in the Plane}, + author = {Beatriz Pateiro-Lopez and Alberto Rodriguez-Casal and {.}}, + year = {2022}, + note = {R package version 2.5}, + url = {https://CRAN.R-project.org/package=alphahull}, +} + +@Manual{aplpack, + title = {aplpack: Another Plot Package: Bagplots, Iconplots, Summaryplots, Slider Functions and Others}, + author = {Hans Peter Wolf}, + year = {2021}, + note = {R package version 1.3.5}, + url = {https://www.uni-bielefeld.de/fakultaeten/wirtschaftswissenschaften/fakultaet/lehrende-ehemalige/pwolf/wolf_aplpack/index.xml}, +} + +@Manual{base, + title = {R: A Language and Environment for Statistical Computing}, + author = {{R Core Team}}, + organization = {R Foundation for Statistical Computing}, + address = {Vienna, Austria}, + year = {2024}, + url = {https://www.R-project.org/}, +} + +@Manual{corrplot, + title = {corrplot: Visualization of a Correlation Matrix}, + author = {Taiyun Wei and Viliam Simko}, + year = {2021}, + note = {R package version 0.92}, + url = {https://github.com/taiyun/corrplot}, +} + +@Manual{formatR, + title = {formatR: Format R Code Automatically}, + author = {Yihui Xie}, + year = {2023}, + note = {R package version 1.14}, + url = {https://github.com/yihui/formatR}, +} + +@Manual{fun, + title = {fun: Use R for Fun}, + author = {Yihui Xie and Yixuan Qiu and Taiyun Wei}, + year = {2020}, + note = {R package version 0.3}, + url = {https://github.com/yihui/fun}, +} + +@Manual{GGally, + title = {GGally: Extension to ggplot2}, + author = {Barret Schloerke and Di Cook and Joseph Larmarange and Francois Briatte and Moritz Marbach and Edwin Thoen and Amos Elberg and Jason Crowley}, + year = {2024}, + note = {R package version 2.2.1}, + url = {https://ggobi.github.io/ggally/}, +} + +@Manual{ggpointdensity, + title = {ggpointdensity: A Cross Between a 2D Density Plot and a Scatter Plot}, + author = {Lukas P. M. Kremer}, + year = {2019}, + note = {R package version 0.1.0}, + url = {https://github.com/LKremer/ggpointdensity}, +} + +@Manual{heatmaply, + title = {heatmaply: Interactive Cluster Heat Maps Using plotly and ggplot2}, + author = {Tal Galili and Alan O'Callaghan}, + year = {2023}, + note = {R package version 1.5.0, https://cran.r-project.org/package=heatmaply, https://github.com/talgalili/heatmaply/}, + url = {https://talgalili.github.io/heatmaply/}, +} + +@Manual{hexbin, + title = {hexbin: Hexagonal Binning Routines}, + author = {Dan Carr and Nicholas Lewin-Koh and Martin Maechler}, + year = {2023}, + note = {R package version 1.28.3}, + url = {https://github.com/edzer/hexbin}, +} + +@Manual{htmlwidgets, + title = {htmlwidgets: HTML Widgets for R}, + author = {Ramnath Vaidyanathan and Yihui Xie and JJ Allaire and Joe Cheng and Carson Sievert and Kenton Russell}, + year = {2023}, + note = {R package version 1.6.4}, + url = {https://github.com/ramnathv/htmlwidgets}, +} + +@Manual{leaflet, + title = {leaflet: Create Interactive Web Maps with the JavaScript Leaflet Library}, + author = {Joe Cheng and Barret Schloerke and Bhaskar Karambelkar and Yihui Xie}, + year = {2024}, + note = {R package version 2.2.2, https://github.com/rstudio/leaflet}, + url = {https://rstudio.github.io/leaflet/}, +} + +@Manual{maps, + title = {maps: Draw Geographical Maps}, + author = {Ray Brownrigg}, + year = {2023}, + note = {R package version 3.4.2}, + url = {https://CRAN.R-project.org/package=maps}, +} + +@Manual{MSG, + title = {MSG: Data and Functions for the Book Modern Statistical Graphics}, + author = {Yihui Xie and Peng Zhao}, + year = {2021}, + note = {R package version 0.8}, + url = {https://github.com/yihui/MSG}, +} + +@Manual{quantreg, + title = {quantreg: Quantile Regression}, + author = {Roger Koenker}, + year = {2023}, + note = {R package version 5.97}, + url = {https://www.r-project.org}, +} + +@Manual{RColorBrewer, + title = {RColorBrewer: ColorBrewer Palettes}, + author = {Erich Neuwirth}, + year = {2022}, + note = {R package version 1.1-3}, + url = {https://CRAN.R-project.org/package=RColorBrewer}, +} + +@Manual{rgl, + title = {rgl: 3D Visualization Using OpenGL}, + author = {Daniel Adler and Duncan Murdoch}, + year = {2024}, + note = {R package version 1.3.1}, + url = {https://github.com/dmurdoch/rgl}, +} + +@Manual{rpart, + title = {rpart: Recursive Partitioning and Regression Trees}, + author = {Terry Therneau and Beth Atkinson}, + year = {2023}, + note = {R package version 4.1.23, https://cran.r-project.org/package=rpart}, + url = {https://github.com/bethatkinson/rpart}, +} + +@Manual{sm, + title = {sm: Smoothing Methods for Nonparametric Regression and Density Estimation}, + author = {Adrian Bowman and Adelchi Azzalini}, + year = {2024}, + note = {R package version 2.2-6.0}, + url = {https://CRAN.R-project.org/package=sm}, +} + +@Manual{TeachingDemos, + title = {TeachingDemos: Demonstrations for Teaching and Learning}, + author = {Greg Snow}, + year = {2024}, + note = {R package version 2.13}, + url = {https://CRAN.R-project.org/package=TeachingDemos}, +} + +@Manual{tikzDevice, + title = {tikzDevice: R Graphics Output in LaTeX Format}, + author = {Charlie Sharpsteen and Cameron Bracken}, + year = {2023}, + note = {R package version 0.12.6}, + url = {https://github.com/daqana/tikzDevice}, +} +@Manual{survival, + title = {A Package for Survival Analysis in R}, + author = {Terry M Therneau}, + year = {2024}, + note = {R package version 3.6-4}, + url = {https://CRAN.R-project.org/package=survival}, +} +@Manual{Matrix, + title = {Matrix: Sparse and Dense Matrix Classes and Methods}, + author = {Douglas Bates and Martin Maechler and Mikael Jagan}, + year = {2024}, + note = {R package version 1.7-0}, + url = {https://CRAN.R-project.org/package=Matrix}, +} +@Manual{KernSmooth, + title = {KernSmooth: Functions for Kernel Smoothing Supporting Wand & Jones (1995)}, + author = {Matt Wand}, + year = {2024}, + note = {R package version 2.23-24}, + url = {https://CRAN.R-project.org/package=KernSmooth}, +} +@Manual{tuneR, + title = {tuneR: Analysis of Music and Speech}, + author = {Uwe Ligges}, + year = {2024}, + note = {R package version 1.4.7}, + url = {https://CRAN.R-project.org/package=tuneR}, +} + +@Manual{vcd, + title = {vcd: Visualizing Categorical Data}, + author = {David Meyer and Achim Zeileis and Kurt Hornik and Michael Friendly}, + year = {2023}, + note = {R package version 1.4-12}, + url = {https://CRAN.R-project.org/package=vcd}, +} + +@Manual{vioplot, + title = {vioplot: Violin Plot}, + author = {Daniel Adler and S. Thomas Kelly and Tom M. Elliott and Jordan Adamson}, + year = {2022}, + note = {R package version 0.4.0}, + url = {https://github.com/TomKellyGenetics/vioplot}, +} + +@Manual{aplpack2019, + title = {{aplpack}: Another Plot Package (version 190512)}, + author = {Hans Peter Wolf}, + year = {2019}, + url = {https://cran.r-project.org/package=aplpack}, +} + +@Manual{corrplot2021, + title = {R package 'corrplot': Visualization of a Correlation Matrix}, + author = {Taiyun Wei and Viliam Simko}, + year = {2021}, + note = {(Version 0.92)}, + url = {https://github.com/taiyun/corrplot}, +} + +@Article{heatmaply2017, + author = {{Galili} and {Tal} and {O'Callaghan} and {Alan} and {Sidi} and {Jonathan} and {Sievert} and {Carson}}, + title = {heatmaply: an R package for creating interactive cluster heatmaps for online publishing}, + journal = {Bioinformatics}, + year = {2017}, + doi = {10.1093/bioinformatics/btx657}, + url = {https://academic.oup.com/bioinformatics/article-pdf/doi/10.1093/bioinformatics/btx657/21358327/btx657.pdf}, +} + +@Manual{sm2024, + title = {{R} package \texttt{sm}: nonparametric smoothing methods (version 2.2-6.0)}, + author = {A. W. Bowman and A. Azzalini}, + address = {University of Glasgow, UK and Universit\`a di Padova, Italia}, + year = {2024}, + url = {http://www.stats.gla.ac.uk/~adrian/sm/}, +} + +@Manual{tuneR2023, + title = {{tuneR}: Analysis of Music and Speech}, + author = {Uwe Ligges and Sebastian Krey and Olaf Mersmann and Sarah Schnackenberg}, + year = {2023}, + url = {https://CRAN.R-project.org/package=tuneR}, +} + +@Article{vcd2006, + title = {The Strucplot Framework: Visualizing Multi-Way Contingency Tables with vcd}, + author = {David Meyer and Achim Zeileis and Kurt Hornik}, + journal = {Journal of Statistical Software}, + year = {2006}, + volume = {17}, + number = {3}, + pages = {1--48}, + doi = {10.18637/jss.v017.i03}, +} + +@Article{vcd2007, + title = {Residual-based Shadings for Visualizing (Conditional) Independence}, + author = {Achim Zeileis and David Meyer and Kurt Hornik}, + journal = {Journal of Computational and Graphical Statistics}, + year = {2007}, + volume = {16}, + number = {3}, + pages = {507--525}, + doi = {10.1198/106186007X237856}, +} + diff --git a/README.md b/README.md index e1f649c..36b1246 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Book build status](https://github.com/XiangyunHuang/MSG-Book/workflows/Render-Book/badge.svg?event=push)](https://github.com/XiangyunHuang/MSG-Book/actions?workflow=Render-Book) ---- +## [![Book build status](https://github.com/XiangyunHuang/msg/workflows/Render-Book/badge.svg?event=push)](https://github.com/XiangyunHuang/msg/actions?workflow=Render-Book) ## 现代统计图形 @@ -11,11 +10,11 @@ This is code and text behind the [Modern Statistical Graphics](https://bookdown. ## 授权 LICENSE -知识共享许可协议 +知识共享许可协议 本作品采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可。 ---- +------------------------------------------------------------------------ ## 益辉答读者问 @@ -45,7 +44,7 @@ This is code and text behind the [Modern Statistical Graphics](https://bookdown. ### 6. 统计图形的艺术性和功能性如何辩证看待? -艺术?艺术就是爆炸(迪达拉),还是永恒(赤砂蝎)?……我个人倾向于功能性优先(即永恒)。如果有人信奉艺术就是爆炸的美学,那我觉得可以关注一下纽约时报的可视化项目,它们有时候很有艺术性。另外有个做可视化的网站叫布丁,我个人觉得它的艺术性非常惊艳,供参考:https://pudding.cool +艺术?艺术就是爆炸(迪达拉),还是永恒(赤砂蝎)?……我个人倾向于功能性优先(即永恒)。如果有人信奉艺术就是爆炸的美学,那我觉得可以关注一下纽约时报的可视化项目,它们有时候很有艺术性。另外有个做可视化的网站叫布丁,我个人觉得它的艺术性非常惊艳,供参考: ### 7. 真的一图胜千言吗?图形承载多大的信息量才合适,或者,清楚明白才是王道? @@ -73,21 +72,21 @@ This is code and text behind the [Modern Statistical Graphics](https://bookdown. ### 11. 您好,我买了这本新书。然后尝试了一下代码,发现: 输出的图表中,不显示汉字,请问这种情况该如何解决? -这种技术性问题不妨到论坛上问:https://d.cosx.org 但请按论坛的规矩发帖,提供相应的系统信息。 +这种技术性问题不妨到论坛上问: 但请按论坛的规矩发帖,提供相应的系统信息。 ### 12. 想问问大佬这本书的定位是怎样的,以及阅读这本书的方法? 本书的前言回答了这个问题。 -### 13. 这本书14年前就在网上开源啦,图灵出的书和网上内容相比,主要有哪些变化? +### 13. 这本书14年前就在网上开源啦,图灵出的书和网上内容相比,主要有哪些变化? -本书的后记里部分回答了这个问题。更详细的对比参见:https://msg2020.pzhao.org +本书的后记里部分回答了这个问题。更详细的对比参见: ### 14. 有哪些值得推荐的数据可视化工具? 这个问题听起来像个知乎问题,有点笼统。我从没在知乎上回答过问题,这个问题我也不知从何答起。什么“值得推荐”取决于“推荐了之后想拿它去做什么”。本书介绍的主要是 R,有点偏统计。现在江湖上的 JavaScript 酷炫可视化库也铺天盖地,我觉得也可以稍微关注一下,具体哪家强我就不点名了(我不是这方面的专家,而且我掌握的信息可能已经落后时代几年了)。 -### 15. 本书对R语言的要求是什么样的? +### 15. 本书对R语言的要求是什么样的? 可以初学者,也可以是熟悉 R 语言的程度。前言中有提到,依据对 R 掌握的不同等级,这本书可以有不同的读法。 @@ -110,5 +109,3 @@ This is code and text behind the [Modern Statistical Graphics](https://bookdown. ### 19. 统计绘图当中,不少GUI软件貌似在不少情况下效率更高:代码 vs GUI 本书的 2.2 小节中谈到了这个问题。如果是一次性的作图、作后即焚,而你感觉图形界面软件好用,那用一次也无妨。如果是注重图形的可重复性,那么用代码作图更方便;比如要是将来发现数据变了,那代码只需要重跑一遍即可,而哪里不会点哪里的图形界面软件就需要你再全程点一遍。 - - diff --git a/_output.yml b/_output.yml index 9219899..76e484a 100644 --- a/_output.yml +++ b/_output.yml @@ -35,6 +35,6 @@ bookdown::pdf_book: extra_dependencies: ctex: - heading - - fontset=fandol + - fontset=adobe pandoc_args: ["--top-level-division=chapter", "--lua-filter=sidebar.lua"] quote_footer: ["\\hspace*{\\fill} ", ""] diff --git a/data.Rmd b/data.Rmd index 3a638c0..a5b0adb 100644 --- a/data.Rmd +++ b/data.Rmd @@ -75,7 +75,7 @@ mosaicplot(table(x, y), main = "(4) 马塞克图") (ref:categorical-display) 分类变量的散点图示方法示例:原始散点图、打散方法、向日葵散点图和马赛克图。 -专门针对混合数据的图形并不多,前面介绍过的条件密度图(\@ref(sec:cdplot) 小节)和棘状图(\@ref(sec:spineplot) 小节)是两个少见的例子。在绝大多数情况下,我们都推荐使用“条件分割”的办法,利用分类变量的各个取值水平分别画二维图形,这样让我们很容易比较分类变量不同取值水平下的二维变量之间关系的差别。基础图形系统中的条件分割图(\@ref(sec:coplot) 小节)只是一个引子,**ggplot2** 包中的切片功能更灵活易用,后面图 \@ref(fig:cn-us-redraw) 便是一例。 +专门针对混合数据的图形并不多,前面介绍过的条件密度图(\@ref(sec:cdplot) 小节)和棘状图(\@ref(sec:spineplot) 小节)是两个少见的例子。在绝大多数情况下,我们都推荐使用“条件分割”的办法,利用分类变量的各个取值水平分别画二维图形,这样让我们很容易比较分类变量不同取值水平下的二维变量之间关系的差别。基础图形系统中的条件分割图(\@ref(sec:coplot) 小节)只是一个引子,**ggplot2** 包中的切片功能更灵活易用。 一定程度上,这种针对数据类型总结图形类型的做法有些死板,例如两个分类变量一般情况下是无法画散点图的,因为分类变量只取有限的几个值,所以两个分类变量之间的散点图通常只是若干个网格点,而这些点本身并不能反映出该位置上真正的频数。我们在第 \@ref(cha:gallery) 章中提到过一些分类变量的图示方法,包括关联图(\@ref(sec:assocplot) 节)、四瓣图(\@ref(sec:fourfoldplot) 节)和马赛克图(\@ref(sec:mosaicplot) 节)等,不过它们都不是最直接的散点图,而是将频数表达在其它图形元素中。那么分类变量是否一定不能画散点图呢?当然不是,向日葵散点图和随机打散的散点图就是两种可能。 @@ -197,34 +197,6 @@ ggparcoord(music, columns = c(4, 5, 3), groupColumn = "type") 尽管三维散点图有种种劣势,但在本例中有一点可以肯定,那就是古典乐和摇滚乐在频率上是有差异的,因为我们可以看到图中的散点并没有混杂在一起,而是有着较好的分隔(请再考虑一下这是否是“事后诸葛亮”的结论)。为了看清具体的数值上的差异,我们可以使用平行坐标图如 \@ref(fig:music-3d-pcp) 下图。古典乐左声道的频率均值相对较高,但最大值相对较低,而且方差非常小,这说明古典乐的演奏频率相对固定在较高的水平上;而摇滚乐的平均频率相对较低,但最大值和方差都很大,这说明摇滚乐的频率波动幅度较大,高方差也可能是因为最大值太大引起的,这似乎让我们不由联想到嘶吼的摇滚歌手,读者若有兴趣,可以用 **tuneR** 包 [@tuneR] 读入信乐团的《离歌》做分析,看是否能看到“低均值高方差”的特征。 -### 中美对比 {#subsec:china-vs-us} - -2011 年 1 月 19 日,英国《卫报》发表了一篇关于中美国力对比的文章,此时正是中国国家主席胡锦涛访美期间,《卫报》称此次访问是“硬实力与软实力的会晤”,文中分析了中美一些经济社会指标的对比,配图如图 \@ref(fig:cn-us-guardian)。总体来说,这幅图形比较有冲击力,能突出两国各自的优势劣势,尤其值得称道的是作者将各个指标进行了排序,这样便于读者阅读;然而如果我们再细看一下,就能发现这幅图存在一个问题:由于指标数值都是用扇形表示,因此容易造成一个误会,即数值大小究竟体现在扇形的半径上还是面积上?这一点可能每个读者的视角都不一样,但这幅图如果按照面积大小去解读数据可能就错了。例如,中国人口是美国人口的 4.3 倍,但图中中国扇形(红色)的面积显然不止是美国的 4.3 倍,这样可能给读者造成一个印象,似乎中国人口是美国的七八倍。 - -该文提供了部分原始数据,我们也收集在 **MSG** 包中的 `cn_vs_us` 数据中(数据帮助文档中有数据来源网址),这里我们利用这些数据重画《卫报》的图形: - -```{r cn-vs-us-data} -data(cn_vs_us) -cn_vs_us[, 1:3] -``` -```{r cn-us-guardian,fig.cap="(ref:cn-us-guardian)",fig.scap="2010 年中美国力对比扇形图 ",echo=FALSE,out.width="70%",fig.link="https://www.guardian.co.uk/news/datablog/2011/jan/19/china-social-media"} -knitr::include_graphics(path = "images/China-v-US-graphic.jpg") -``` - -(ref:cn-us-guardian) 2010 年中美国力对比:中国人口多、污染重、GDP 增长快;美国人均 GDP 高、市值高、失业率高。 - -```{r cn-us-redraw,fig.cap="(ref:cn-us-redraw)",fig.scap="2010 年中美国力对比条形图"} -ggplot(data = cn_vs_us, aes(x = country, y = value, fill = country)) + - geom_col() + - facet_wrap(~metric, scales = "free_y", ncol = 3) -``` - -(ref:cn-us-redraw) 重新调整后的 2010 年中美国力对比图:条形图的高度表达数值大小更清楚(图中红色代表中国)。 - -由于我们的主要目的是比较两国的指标,因此简单的条形图足以完成这个任务,如图 \@ref(fig:cn-us-redraw) 所示。我们大致上按中国指标与美国指标的比率大小排列这些条形图,这幅图看起来比《卫报》的图形逊色许多,但不会造成任何误解,也能更客观反映两国差异。当然,更好的解决方案可能是保持原有的“放射性”设计,但把扇形替换为矩形条。 - -我们在检查《卫报》提供的数据表时发现表中“市值”(Market Capitalisation)一栏中美数据被颠倒了,对比原图和我们重画的图让我们很快注意到了这个差异。数据的录入错误无处不在,而看数字不如看图形更直观这一点也让我们相信图形在检查错误方面有其特殊价值。 - ### 绝望主妇 {#subsec:tvearn} diff --git a/foreword.Rmd b/foreword.Rmd index 9118259..db4b513 100644 --- a/foreword.Rmd +++ b/foreword.Rmd @@ -21,7 +21,7 @@ 1. 数学只是研究统计学的一种角度,它奠定了统计学的理论基础,但这不是统计学的终点或全部; -本书的所有图形文件和程序代码可以从 Github 仓库下载(),另外本书也配有相应的 R 包 **MSG** [@MSG], 使用说明参见附录 \@ref(cha:MSG)。阅读本书过程中若有任何疑问请 Email 联系作者:。 +本书的所有图形文件和程序代码可以从 Github 仓库下载(),另外本书也配有相应的 R 包 **MSG** [@MSG], 使用说明参见附录 \@ref(chap:MSG)。阅读本书过程中若有任何疑问请 Email 联系作者:。 关于本书中 R 程序代码,记号说明如下: diff --git a/index.Rmd b/index.Rmd index bf33399..dbda181 100644 --- a/index.Rmd +++ b/index.Rmd @@ -30,45 +30,28 @@ geometry: description: "现代统计图形书稿" subject: "统计图形, 数据可视化" keywords: -- R 语言 -- 统计图形 -- 统计学 -- 图形元素 -- 图形系统 -- 统计图形软件 -- 数据可视化 + - R 语言 + - 统计图形 + - 统计学 + - 图形元素 + - 图形系统 + - 统计图形软件 + - 数据可视化 github-repo: XiangyunHuang/msg url: 'https\://bookdown.org/xiangyun/msg/' --- -```{r setup,include=FALSE} -# 安装本书需要的 R 包,按字母排序 -lapply(c( - "alphahull", "animation", "aplpack", "bookdown", - "corrplot", "cowplot", "formatR", "fun", - "GGally", "ggplot2", "igraph", - "magick", "maps", "maptools", "MSG", "mvtnorm", - "pdftools", "plot3D", "plotrix", - "randomForest", "rgeos", "rgl", - "scatterplot3d", "showtext", "sna", "sp", "svglite", - "TeachingDemos", "tikzDevice", "vcd", "vioplot" -), function(pkg) { - if (system.file(package = pkg) == "") install.packages(pkg) -}) -``` # 推荐语 {#welcome .unnumbered} - -互联网技术革命对统计学之影响是向人类社会量化解析自然生态和社会生态的深度进军,广 义统计是一个深入发展统计思想期待的重心,其中,最为突出的具有龙头发展地位的是广义统计 系统数据信息的可视化,它是当今人类社会发展在互联网平台化所有领域中实现认知、社会学习、 分析研究、系统应用扁平化的科学手段。面对可视化的“现代统计图形”,可以适应任何人所拥 有知识起点之认知学习,激发社会化学习研究之创新,对所有学科知识交叉应用可以升起不落的 -“发展力太阳”。对此,《现代统计图形》做出了杰出的贡献。 +互联网技术革命对统计学之影响是向人类社会量化解析自然生态和社会生态的深度进军,广义统计是一个深入发展统计思想期待的重心,其中,最为突出的具有龙头发展地位的是广义统计系统数据信息的可视化,它是当今人类社会发展在互联网平台化所有领域中实现认知、社会学习、分析研究、系统应用扁平化的科学手段。面对可视化的“现代统计图形”,可以适应任何人所拥有知识起点之认知学习,激发社会化学习研究之创新,对所有学科知识交叉应用可以升起不落的“发展力太阳”。对此,《现代统计图形》做出了杰出的贡献。 ```{block2, type = 'flushright', html.tag = 'p'} 赵彦云 中国人民大学统计学院教授 ``` -我认识老谢有 19 年了,等这本书的出版就等了 14 年。我在工作、学习中从这本书里获得了 很多灵感,我自己写的书里也多次引用了这本书网络版的内容。这不仅是一本统计图形的工具书 和参考书,更可以作为统计思维的人生之书。 +我认识老谢有 19 年了,等这本书的出版就等了 14 年。我在工作、学习中从这本书里获得了很多灵感,我自己写的书里也多次引用了这本书网络版的内容。这不仅是一本统计图形的工具书和参考书,更可以作为统计思维的人生之书。 ```{block2, type = 'flushright', html.tag = 'p'} 李舰 @@ -76,26 +59,25 @@ lapply(c( ``` 《现代统计图形》的雏形始于 2007 年,那一年我还在中国人民大学统计学院读大四,益辉师 -兄(老谢)比我高一级。他能坚持 14 年把书稿高质量地呈现给读者,彰显着现代统计人的初心。 +兄(老谢)比我高一级。他能坚持 14 年把书稿高质量地呈现给读者,彰显着现代统计人的初心。 -这本书以浅显而有趣的图形示例将统计学和可视化的历史娓娓道来,是一本难得的以图形为 主线、探讨统计学和统计可视化的高质量通识读物。书中内容无不体现作者对现代统计和统计图 形的深刻思考,例如“神奇数字”和“作图原则”等章节。这本书既可作为高校师生的统计计算 或者统计软件中可视化章节的主要参考书,也可作为严谨学术作图的指导手册。 +这本书以浅显而有趣的图形示例将统计学和可视化的历史娓娓道来,是一本难得的以图形为主线、探讨统计学和统计可视化的高质量通识读物。书中内容无不体现作者对现代统计和统计图形的深刻思考,例如“神奇数字”和“作图原则”等章节。这本书既可作为高校师生的统计计算或者统计软件中可视化章节的主要参考书,也可作为严谨学术作图的指导手册。 ```{block2, type = 'flushright', html.tag = 'p'} 李丰 中央财经大学统计与数学学院副院长、副教授 ``` -缺乏信心作出预期的图形吗?希望用 R 基本代码随意生成任何图形吗?欲用“半傻瓜”方法 构造漂亮而又时髦的图形吗?渴望知道图形背后的原理及数学吗?愿意把画图作为乐趣吗?想 要轻松地阅读一本关于编程软件的书吗?答案很简单:读这本《现代统计图形》! +缺乏信心作出预期的图形吗?希望用 R 基本代码随意生成任何图形吗?欲用“半傻瓜”方法 构造漂亮而又时髦的图形吗?渴望知道图形背后的原理及数学吗?愿意把画图作为乐趣吗?想 要轻松地阅读一本关于编程软件的书吗?答案很简单:读这本《现代统计图形》! ```{block2, type = 'flushright', html.tag = 'p'} 吴喜之 中国人民大学统计学院教授 ``` -纷繁嘈杂的数据经过科学的处理、加工之后,映入眼帘的是生动、直观、一图胜千言的统计 -图形,这个美妙的过程称为可视化分析,是数据科学中极为重要的部分。 +纷繁嘈杂的数据经过科学的处理、加工之后,映入眼帘的是生动、直观、一图胜千言的统计图形,这个美妙的过程称为可视化分析,是数据科学中极为重要的部分。 -益辉兄的这本《现代统计图形》不仅高屋建瓴,概述了可视化分析的前世今生和哲学理念。 同时,内容包罗万象,精彩纷呈。从最常用的条形图、直方图,到根据不同场景和数据自定义图 形;从各种图形的思想和理论,到具体的案例和代码;从作图的细节参数,到不同的作图框架; 处处闪耀着智慧的火花,令人目不暇接,收获颇丰。 +益辉兄的这本《现代统计图形》不仅高屋建瓴,概述了可视化分析的前世今生和哲学理念。 同时,内容包罗万象,精彩纷呈。从最常用的条形图、直方图,到根据不同场景和数据自定义图 形;从各种图形的思想和理论,到具体的案例和代码;从作图的细节参数,到不同的作图框架; 处处闪耀着智慧的火花,令人目不暇接,收获颇丰。 本人有幸在 10 年前,参与了这本书初稿的审阅校对,更有幸的是 10 年后,亲眼看见这本书 正式与读者见面。甚为欣慰,特此推荐。 @@ -138,7 +120,7 @@ lapply(c( ``` -大数据统计或挖掘结果的图形化,是人们快速观察并发现数据隐藏信息或新颖知识的有效方 法。统计图形不仅是大数据统计和挖掘结果的可视化利器,也是高水平学术成果的重要组成部分。 +大数据统计或挖掘结果的图形化,是人们快速观察并发现数据隐藏信息或新颖知识的有效方法。统计图形不仅是大数据统计和挖掘结果的可视化利器,也是高水平学术成果的重要组成部分。 《现代统计图形》集趣味性、知识性、技术性和实践性于一体,是作者浓缩多年用 R 语言制作统 计图形经验的匠心之作。这本书不仅可作为高校统计学、数据科学与大数据技术等专业本科生的选修课教材,也可作为高校硕士和博士研究生用 R 语言作图的快速入门参考书。利用这本书提供 的 R 语言作图源程序,读者可轻松掌握其基本方法,并在不知不觉中快速成长为使用 R 语言及 其绘图包 ggplot2 制作统计图形的高手。 @@ -148,7 +130,7 @@ lapply(c( “十一五”“十二五”国家级规划教材作者,浙江省教学名师 ``` -数据可视化的学习之中,存在“道”与“术”两个不同层面。“术”为工具的使用,包括程 序语言、作图函数等;“道”为作图思想,是逻辑、统计知识、审美等多方面的综合。这本书极 难得地将二者相结合,不空谈道,也不局限于术。在每个阶段读,都有不同的收获。同时,还辅 以百余种常见统计图形为案例解析,实乃不可多得之佳作。 +数据可视化的学习之中,存在“道”与“术”两个不同层面。“术”为工具的使用,包括程序语言、作图函数等;“道”为作图思想,是逻辑、统计知识、审美等多方面的综合。这本书极难得地将二者相结合,不空谈道,也不局限于术。在每个阶段读,都有不同的收获。同时,还辅以百余种常见统计图形为案例解析,实乃不可多得之佳作。 ```{block2, type = 'flushright', html.tag = 'p'} 王建栋 @@ -163,14 +145,14 @@ lapply(c( 南方科技大学研究助理教授 ``` -如果你一直在寻找一本能循循善诱带你入门,又能一路托你到卓尔不群的统计图形真经,就 是这本《现代统计图形》。但是作者们并非仅仅醉心于打造一本“图形形式美”的工具辞典,对 贯通数学原理与图形表达,从认知逻辑出发优化视觉传达,权衡图形的直观呈现与统计价值等问 7 题的思考暴露了三位作者的“数学艺术家”本质。木心有句:“思维、情操的创造性必然伴随着 形式的创造性。”说的就是这些人、这本书吧。 +如果你一直在寻找一本能循循善诱带你入门,又能一路托你到卓尔不群的统计图形真经,就 是这本《现代统计图形》。但是作者们并非仅仅醉心于打造一本“图形形式美”的工具辞典,对 贯通数学原理与图形表达,从认知逻辑出发优化视觉传达,权衡图形的直观呈现与统计价值等问题的思考暴露了三位作者的“数学艺术家”本质。木心有句:“思维、情操的创造性必然伴随着形式的创造性。”说的就是这些人、这本书吧。 ```{block2, type = 'flushright', html.tag = 'p'} 刘倩 中央财经大学财经研究院副研究员 ``` -这本书溯流从源地带着读者领略数据可视化技术的本质之“道”:可视化终究是数学的直观 图形表达,而熟练偏向底层的技术才能使得表达过程不受束缚。即使这本书被谢大拖稿 14 年, 依然被众多读者千呼万唤始出来,足见其超越技术本身,而道出数据可视化之本质的价值。 +这本书溯流从源地带着读者领略数据可视化技术的本质之“道”:可视化终究是数学的直观图形表达,而熟练偏向底层的技术才能使得表达过程不受束缚。即使这本书被谢大拖稿 14 年,依然被众多读者千呼万唤始出来,足见其超越技术本身,而道出数据可视化之本质的价值。 ```{block2, type = 'flushright', html.tag = 'p'} 夏骁凯 @@ -184,7 +166,7 @@ lapply(c( 南京信息工程大学水文与水资源工程学院副院长、教授、博士生导师 ``` -《现代统计图形》读起来就像一本由武林前辈撰写的兵器图谱,其中不仅包含兵器(R 作图 元素及工具)展示、武功心法(统计学知识及作图原则),更有不少江湖趣事(统计图形简史及 案例分析)。不管你是江湖少侠(熟悉 R 或统计学),或者初入江湖(刚开始学习 R 或统计学), 我相信这本书都能帮你提高一层境界。即便是如我一般的小白,也多半会被作者们幽默诙谐的语 言、娓娓道来的叙述,以及层层递进的剖析深深吸引,而受益匪浅。 +《现代统计图形》读起来就像一本由武林前辈撰写的兵器图谱,其中不仅包含兵器(R 作图 元素及工具)展示、武功心法(统计学知识及作图原则),更有不少江湖趣事(统计图形简史及 案例分析)。不管你是江湖少侠(熟悉 R 或统计学),或者初入江湖(刚开始学习 R 或统计学), 我相信这本书都能帮你提高一层境界。即便是如我一般的小白,也多半会被作者们幽默诙谐的语 言、娓娓道来的叙述,以及层层递进的剖析深深吸引,而受益匪浅。 ```{block2, type = 'flushright', html.tag = 'p'} 叶飞 @@ -206,48 +188,46 @@ lapply(c( 作者亦非常注重美感,读者从书的排版、布局、文字、图形和颜色的区分等方面都可以感受 到美的力量。 -了解或熟知谢益辉其人的读者,从此书中可读出作者青春的印记,“四时可爱唯春日,一事 能狂便少年”。完全陌生的读者,看到此书便是缘分,愿你在运行书中代码、思考作者提出的小 结问题之中,获得启蒙。 +了解或熟知谢益辉其人的读者,从此书中可读出作者青春的印记,“四时可爱唯春日,一事能狂便少年”。完全陌生的读者,看到此书便是缘分,愿你在运行书中代码、思考作者提出的小结问题之中,获得启蒙。 ```{block2, type = 'flushright', html.tag = 'p'} 李承文 不懂统计学的平常百姓 ``` -谢益辉是 R 扩展包 bookdown 的作者,他和两位合作者的这本新书可以作为学习 R 统计图形 的教材和参考手册,其中许多图形是现有中文 R 语言教材中没有涉及的。书中还精练、准确地概 括了 R 基础作图、ggplot 作图系统,并用许多饶有趣味的实例深入浅出地介绍了重要的统计图形 原则。 +谢益辉是 R 扩展包 bookdown 的作者,他和两位合作者的这本新书可以作为学习 R 统计图形的教材和参考手册,其中许多图形是现有中文 R 语言教材中没有涉及的。书中还精练、准确地概 括了 R 基础作图、ggplot2 作图系统,并用许多饶有趣味的实例深入浅出地介绍了重要的统计图形 原则。 ```{block2, type = 'flushright', html.tag = 'p'} 李东风 北京大学数学科学学院副教授 ``` -在我的理解中,统计分析的过程和把大象关在冰箱里的步骤是一样的。第一步,把庞杂的原 始数据整理成统计软件可以接受的形式;第二步,运用恰当的方法进行分析;第三步,通过图形 等方式,把结果表达为人类便于理解的形式。我们的教育只重视第二步,导致很多人于实际中在 第一步和第三步中遇到了困难。对于第一步,必须要学习一门处理数据的语言,比如 R。而对于 第三步,一直以来没有很好的解决方案,直到这本《现代统计图形》的出现。 +在我的理解中,统计分析的过程和把大象关在冰箱里的步骤是一样的。第一步,把庞杂的原 始数据整理成统计软件可以接受的形式;第二步,运用恰当的方法进行分析;第三步,通过图形 等方式,把结果表达为人类便于理解的形式。我们的教育只重视第二步,导致很多人于实际中在 第一步和第三步中遇到了困难。对于第一步,必须要学习一门处理数据的语言,比如 R。而对于 第三步,一直以来没有很好的解决方案,直到这本《现代统计图形》的出现。 ```{block2, type = 'flushright', html.tag = 'p'} 姜晓东 湖南师范大学医学院讲师 ``` -我们已经进入了眼球经济时代,获得注意力就是获得财富。在我多年指导学生的实践中,越 发感受到图对于提升科研成果价值的重要性。今日翻开《现代统计图形》,如获至宝。作者深入 浅出地将枯燥的作图工具娓娓道来,一张张精美的图片更映射出作者的情感、心境和人生态度。 6 相信这本书定能使广大读者发现作图的快乐! +我们已经进入了眼球经济时代,获得注意力就是获得财富。在我多年指导学生的实践中,越 发感受到图对于提升科研成果价值的重要性。今日翻开《现代统计图形》,如获至宝。作者深入 浅出地将枯燥的作图工具娓娓道来,一张张精美的图片更映射出作者的情感、心境和人生态度。相信这本书定能使广大读者发现作图的快乐! ```{block2, type = 'flushright', html.tag = 'p'} 袁自冰 华南理工大学教授、博士生导师 ``` -你或许追过周更的动漫,季更的网剧,年更的小说,但你追过十年更的《现代统计图形》吗? -我追过。 +你或许追过周更的动漫,季更的网剧,年更的小说,但你追过十年更的《现代统计图形》吗?我追过。 -惊闻被谢大戏称为“古统”的《现代统计图形》即将问世,一时竟有不知今夕何年之感。翻 了翻过去的通讯记录,发现整整十年前谢大曾发了封邮件,问道:“你最近有空帮我写两节书 吗?”从此我知道了这本书的存在,并开启了长达十年的催更之路。 +惊闻被谢大戏称为“古统”的《现代统计图形》即将问世,一时竟有不知今夕何年之感。翻 了翻过去的通讯记录,发现整整十年前谢大曾发了封邮件,问道:“你最近有空帮我写两节书 吗?”从此我知道了这本书的存在,并开启了长达十年的催更之路。 -谢大所谓“古统”虽是戏谑之语,但也能读出其中的疑问:什么是统计图形的现代元素?按 我的理解,统计图形最大的价值就在于它能加深人们对其背后数据的认识,而现代与否,关键在于 图形能否为数据和问题提供了新的思考和解读。“图”虽旧“码”,其命维新。相信在阅读这本书后, 读者会得益于其中的“探案过程”,学会用统计图形这一强大的工具去探究数据背后的秘密。 +谢大所谓“古统”虽是戏谑之语,但也能读出其中的疑问:什么是统计图形的现代元素?按我的理解,统计图形最大的价值就在于它能加深人们对其背后数据的认识,而现代与否,关键在于图形能否为数据和问题提供了新的思考和解读。“图”虽旧“码”,其命维新。相信在阅读这本书后,读者会得益于其中的“探案过程”,学会用统计图形这一强大的工具去探究数据背后的秘密。 ```{block2, type = 'flushright', html.tag = 'p'} 邱怡轩 统计之都理事,上海财经大学青年教师 ``` -赵鹏老师的博客“大鹏志”曾陪伴我走过学 R 语言最为艰难的一段时光。他用虽朴实无华但 不失风趣的语言,以讲道理的方式,循循善诱地告诉你为什么如此做、应该和可以怎么做。此后 出版的《学 R:零基础学习 R 语言》更是让我爱不释手、如获至宝。而打开《现代统计图形》之后,惊叹图形在 R 语言中可以如此被“调教”,一步步地跟着这本书的思路走,相信每个人都可 -以找到属于自己风格的绘图方式,特此推荐。 +赵鹏老师的博客“大鹏志”曾陪伴我走过学 R 语言最为艰难的一段时光。他用虽朴实无华但 不失风趣的语言,以讲道理的方式,循循善诱地告诉你为什么如此做、应该和可以怎么做。此后 出版的《学 R:零基础学习 R 语言》更是让我爱不释手、如获至宝。而打开《现代统计图形》之后,惊叹图形在 R 语言中可以如此被“调教”,一步步地跟着这本书的思路走,相信每个人都可以找到属于自己风格的绘图方式,特此推荐。 ```{block2, type = 'flushright', html.tag = 'p'} 杨雷峰 @@ -257,9 +237,9 @@ lapply(c( 多年后,面对即将出版的《现代统计图形》,我不禁回想起,在网上初见其书稿的那个遥远 的下午。 -我想,当年看过网上流传的《现代统计图形》书稿的人大多应该和我一样,一直盼着它的正 式出版,然而,作者一“鸽”就是多年(后来才听说原来是磨刀去了——knitr、bookdown......), 直到最近终于要成书了。R 作为一门为统计而生的语言,长处之一就是其灵活的作图系统——正 所谓一图胜千言,有比把枯燥的数字变为漂亮的图形更好地展示统计思想的方法吗?然而 R 作图 系统的灵活和强大也带来了相对陡峭的学习曲线。在《现代统计图形》里,作者们用流畅风趣的 语言为读者讲解构成图形的元素,并展示在 R 里如何将它们组合起来表达统计思想,在降低学习 难度的同时,还为学习统计图形增添了许多乐趣。 +我想,当年看过网上流传的《现代统计图形》书稿的人大多应该和我一样,一直盼着它的正 式出版,然而,作者一“鸽”就是多年(后来才听说原来是磨刀去了 —— knitr、bookdown),直到最近终于要成书了。R 作为一门为统计而生的语言,长处之一就是其灵活的作图系统 —— 正所谓一图胜千言,有比把枯燥的数字变为漂亮的图形更好地展示统计思想的方法吗?然而 R 作图系统的灵活和强大也带来了相对陡峭的学习曲线。在《现代统计图形》里,作者们用流畅风趣的 语言为读者讲解构成图形的元素,并展示在 R 里如何将它们组合起来表达统计思想,在降低学习难度的同时,还为学习统计图形增添了许多乐趣。 -书稿诞生后的这些年里,R 的江湖里兴兴废废出现了各种作图系统。大浪淘沙后,现在最常 使用的除了 R 的基础作图系统外,就是 ggplot2 了。在这本书中,作者们不仅介绍了各个作图系 统,还展示了用基础作图系统和 ggplot2 实现相同图形的代码。R 的基础作图系统和 ggplot2 在作 图上各有千秋,用这两种方式实现同一图形能更好地让读者体会各系统的优劣,以便在自己的数 据分析中选用合适的方式绘制图形。 +书稿诞生后的这些年里,R 的江湖里兴兴废废出现了各种作图系统。大浪淘沙后,现在最常使用的除了 R 的基础作图系统外,就是 ggplot2 了。在这本书中,作者们不仅介绍了各个作图系统,还展示了用基础作图系统和 ggplot2 实现相同图形的代码。R 的基础作图系统和 ggplot2 在作 图上各有千秋,用这两种方式实现同一图形能更好地让读者体会各系统的优劣,以便在自己的数 据分析中选用合适的方式绘制图形。 ```{block2, type = 'flushright', html.tag = 'p'} @@ -267,14 +247,14 @@ lapply(c( 日本基础生物研究所技术支援员 ``` -第一次看到《现代统计图形》的书稿大约是在 10 年前,当时惊艳于它对统计图形全面、系统 的讲解,惊为天人。10 年后,重读此书——即便 ggplot2 已经成为统计图形的标配,但我们依然可 以从问题到数据、数据到图形的诸多案例中明白:为什么呈现的图形是这个样子。该书分门别类地 讲述了统计图形的图库、准则和系统,字里行间传递的“为什么”则更为精彩,正本溯源是《现代 统计图形》最大的价值。如果读者第一次阅读此书,相信也会和我 10 年前的感受一样,enjoy it ! +第一次看到《现代统计图形》的书稿大约是在 10 年前,当时惊艳于它对统计图形全面、系统的讲解,惊为天人。10 年后,重读此书——即便 ggplot2 已经成为统计图形的标配,但我们依然可以从问题到数据、数据到图形的诸多案例中明白:为什么呈现的图形是这个样子。该书分门别类地讲述了统计图形的图库、准则和系统,字里行间传递的“为什么”则更为精彩,正本溯源是《现代统计图形》最大的价值。如果读者第一次阅读此书,相信也会和我 10 年前的感受一样,enjoy it ! ```{block2, type = 'flushright', html.tag = 'p'} 刘思喆 51Talk 首席数据科学家 ``` -信息爆炸,数据称王,好文章不看辞藻看图表。这本书好似一本秘籍,照着例子依猫画虎, 可练外功,任意数据均可成图做表;照着目录由简入繁,可获内功,枯燥数据变成生动图表。所 有和数据打交道的人,都值得入手一本,需要的时候翻翻。你会发现这本书不需要全部读懂,读 半本就可治天下图表。 +信息爆炸,数据称王,好文章不看辞藻看图表。这本书好似一本秘籍,照着例子依猫画虎, 可练外功,任意数据均可成图做表;照着目录由简入繁,可获内功,枯燥数据变成生动图表。所 有和数据打交道的人,都值得入手一本,需要的时候翻翻。你会发现这本书不需要全部读懂,读 半本就可治天下图表。 ```{block2, type = 'flushright', html.tag = 'p'} 陈正 @@ -282,7 +262,7 @@ lapply(c( ``` 作为科研成果展示形式的关键组成部分,作图发挥着不可替代的重要作用。当今很多顶级 期刊采用的论文,大多配有恰如其分且赏心悦目的插图,这不仅有助于准确而深刻地表达学术 思想和结果,而且会令论文大为增色。为此,我向我的学生们推荐这本《现代统计图形》。这本 书细致入微地从基本的统计思想出发,详述了常见科技制图的理论和实例,是我的学生赵鹏继 -《学 R:零基础学习 R 语言》一书出版后,与另外两位作者合著的又一力作。 +《学 R:零基础学习 R 语言》一书出版后,与另外两位作者合著的又一力作。 ```{block2, type = 'flushright', html.tag = 'p'} @@ -290,36 +270,10 @@ lapply(c( 北京大学教授、博士生导师,北京大学环境科学与工程学院院长 ``` -可视化是人与数据沟通的桥梁,也是人类观察数据世界的放大镜。可视化相关的教材很多, 很多描绘了通过可视化看到数据的种种绚丽多彩的画卷,但是很少能向读者详细解释如何构建这 样的“放大镜”。从这一意义上来说,这本作者聚十四年之力而作的《现代统计图形》尤其值得 推荐。它不只介绍了可视化的概念和方法,书中对每一个常用的可视化方法都给出了 R 语言的实 验细节,这是很多可视化实践者的福音。这本书的发行,必将极大地促进可视化的推广和应用。 +可视化是人与数据沟通的桥梁,也是人类观察数据世界的放大镜。可视化相关的教材很多,很多描绘了通过可视化看到数据的种种绚丽多彩的画卷,但是很少能向读者详细解释如何构建这样的“放大镜”。从这一意义上来说,这本作者聚十四年之力而作的《现代统计图形》尤其值得推荐。它不只介绍了可视化的概念和方法,书中对每一个常用的可视化方法都给出了 R 语言的实验细节,这是很多可视化实践者的福音。这本书的发行,必将极大地促进可视化的推广和应用。 ```{block2, type = 'flushright', html.tag = 'p'} 袁晓如 北京大学“百人计划”研究员,北京大学信息科学技术学院博士生导师 ``` - - -```{r bib,include=FALSE,cache=FALSE} -# automatically create a bib database for R packages -bib <- knitr::write_bib( - x = c( - .packages(), - "alphahull", "aplpack", "corrplot", - "formatR", "fun", "KernSmooth", - "GGally", "ggpointdensity", - "hexbin", "htmlwidgets", "heatmaply", - "leaflet", - "MSG", "maps", "Matrix", - "quantreg", - "rgl", "rpart", "RColorBrewer", - "sm", "survival", - "TeachingDemos", "tikzDevice", "tuneR", - "vcd", "vioplot" - ), file = NULL, prefix = "" -) -bib <- unlist(bib) -# remove the ugly single quotes required by CRAN policy -bib <- gsub("(\\\n)", " ", bib) -bib <- gsub("'(Htmlwidgets|iframes|TeX Live|LaTeX|ggplot2|plotly|Leaflet|GGobi)'", "\\1", bib) -xfun::write_utf8(bib, "MSG-packages.bib") -``` diff --git a/msg.Rmd b/msg.Rmd index 5d0b028..5c596c5 100644 --- a/msg.Rmd +++ b/msg.Rmd @@ -1,4 +1,4 @@ -# 本书 R 包 {#cha:MSG} +# 本书 R 包 {#chap:MSG} ```{r include=FALSE} library(MSG) diff --git a/principle.Rmd b/principle.Rmd index f8acd60..0c83cfa 100644 --- a/principle.Rmd +++ b/principle.Rmd @@ -38,8 +38,7 @@ plot(pay/10^4 ~ rating, data = tvearn, pch = 19, ylab = "pay (10^4)") # 改为 par(mfrow = c(1, 2), mar = c(3.2, 3.6, .05, .05)) plot(log10(pay) ~ rating, data = tvearn, pch = 19) plot(log10(pay) ~ rating, data = tvearn, pch = 20, ylab = "", col = "red") -library(maptools) -with(tvearn, pointLabel(rating, log10(pay), labels = actor, +with(tvearn, car::pointLabel(rating, log10(pay), labels = actor, cex = .6, col = "#00000099", xpd = TRUE)) ``` diff --git a/renv.lock b/renv.lock deleted file mode 100644 index 42d3afd..0000000 --- a/renv.lock +++ /dev/null @@ -1,1735 +0,0 @@ -{ - "R": { - "Version": "4.1.0", - "Repositories": [ - { - "Name": "CRAN", - "URL": "https://cran.r-project.org/" - } - ] - }, - "Packages": { - "BH": { - "Package": "BH", - "Version": "1.75.0-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e4c04affc2cac20c8fec18385cd14691" - }, - "DBI": { - "Package": "DBI", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "030aaec5bc6553f35347cbb1e70b1a17" - }, - "GGally": { - "Package": "GGally", - "Version": "2.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b1be92f7d872bd8b7d97ce8a21634ad2" - }, - "KMsurv": { - "Package": "KMsurv", - "Version": "0.1-5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "aee647d15e5541ad44d157f7b78fda01" - }, - "KernSmooth": { - "Package": "KernSmooth", - "Version": "2.23-20", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8dcfa99b14c296bc9f1fd64d52fd3ce7" - }, - "MASS": { - "Package": "MASS", - "Version": "7.3-54", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0e59129db205112e3963904db67fd0dc" - }, - "MSG": { - "Package": "MSG", - "Version": "0.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d0aa9a5fa3128f50693edd4b7db6cc1d" - }, - "Matrix": { - "Package": "Matrix", - "Version": "1.3-4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4ed05e9c9726267e4a5872e09c04587c" - }, - "MatrixModels": { - "Package": "MatrixModels", - "Version": "0.5-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "366a8838782928e398b8762c932a42a3" - }, - "R.methodsS3": { - "Package": "R.methodsS3", - "Version": "1.8.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4bf6453323755202d5909697b6f7c109" - }, - "R.oo": { - "Package": "R.oo", - "Version": "1.24.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5709328352717e2f0a9c012be8a97554" - }, - "R.utils": { - "Package": "R.utils", - "Version": "2.10.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a9e316277ff12a43997266f2f6567780" - }, - "R6": { - "Package": "R6", - "Version": "2.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b203113193e70978a696b2809525649d" - }, - "RColorBrewer": { - "Package": "RColorBrewer", - "Version": "1.1-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e031418365a7f7a766181ab5a41a5716" - }, - "RCurl": { - "Package": "RCurl", - "Version": "1.98-1.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ddac9abbfba243f9aeab9b5680b968d3" - }, - "Rcpp": { - "Package": "Rcpp", - "Version": "1.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "dbb5e436998a7eba5a9d682060533338" - }, - "RcppArmadillo": { - "Package": "RcppArmadillo", - "Version": "0.10.5.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b1c9574190c1c84417eedaa5901138bf" - }, - "RcppEigen": { - "Package": "RcppEigen", - "Version": "0.3.3.9.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ddfa72a87fdf4c80466a20818be91d00" - }, - "RgoogleMaps": { - "Package": "RgoogleMaps", - "Version": "1.4.5.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bffdcd07380ea0a95228588f8aa93734" - }, - "SparseM": { - "Package": "SparseM", - "Version": "1.81", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2042cd9759cc89a453c4aefef0ce9aae" - }, - "TSP": { - "Package": "TSP", - "Version": "1.1-10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "58f127ba1d26ddb0435f9959e814dbea" - }, - "TeachingDemos": { - "Package": "TeachingDemos", - "Version": "2.12", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "41e566d7eab7307a31b3dee3b203c7e0" - }, - "abind": { - "Package": "abind", - "Version": "1.4-5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4f57884290cc75ab22f4af9e9d4ca862" - }, - "alphahull": { - "Package": "alphahull", - "Version": "2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4523ae9a7171830c74e75ace15a2fabb" - }, - "animation": { - "Package": "animation", - "Version": "2.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b726b7119ba99cc79dfdd24cb4ee6894" - }, - "aplpack": { - "Package": "aplpack", - "Version": "1.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9992fc89aceb5e7ba94aefc556e24415" - }, - "askpass": { - "Package": "askpass", - "Version": "1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e8a22846fff485f0be3770c2da758713" - }, - "assertthat": { - "Package": "assertthat", - "Version": "0.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "50c838a310445e954bc13f26f26a6ecf" - }, - "av": { - "Package": "av", - "Version": "0.6.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7b9f9e6c30a4f3bb0edc1f4cba3fe84b" - }, - "backports": { - "Package": "backports", - "Version": "1.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "644043219fc24e190c2f620c1a380a69" - }, - "base64enc": { - "Package": "base64enc", - "Version": "0.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "543776ae6848fde2f48ff3816d0628bc" - }, - "bitops": { - "Package": "bitops", - "Version": "1.0-7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b7d8d8ee39869c18d8846a184dd8a1af" - }, - "bookdown": { - "Package": "bookdown", - "Version": "0.22", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8fb0b67dfdf9d751fc93cb0036def3cc" - }, - "boot": { - "Package": "boot", - "Version": "1.3-28", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0baa960e3b49c6176a4f42addcbacc59" - }, - "broom": { - "Package": "broom", - "Version": "0.7.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2368dde18d8ef1ca933e7e2eea3ece57" - }, - "bslib": { - "Package": "bslib", - "Version": "0.2.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2f069f3f42847231aef7baa49bed97b0" - }, - "caTools": { - "Package": "caTools", - "Version": "1.18.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "34d90fa5845004236b9eacafc51d07b2" - }, - "cachem": { - "Package": "cachem", - "Version": "1.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5346f76a33eb7417812c270b04a5581b" - }, - "callr": { - "Package": "callr", - "Version": "3.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "461aa75a11ce2400245190ef5d3995df" - }, - "car": { - "Package": "car", - "Version": "3.0-10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "12d8cdaf73c30b8c8cb7a22591a3f57d" - }, - "carData": { - "Package": "carData", - "Version": "3.0-4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7ff5c94cec207b3fd9774cfaa5157738" - }, - "cellranger": { - "Package": "cellranger", - "Version": "1.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f61dbaec772ccd2e17705c1e872e9e7c" - }, - "class": { - "Package": "class", - "Version": "7.3-19", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "1593b7beb067c8381c0d24e38bd778e0" - }, - "classInt": { - "Package": "classInt", - "Version": "0.4-3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "17bdfa3c51df4a6c82484d13b11fb380" - }, - "cli": { - "Package": "cli", - "Version": "2.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a94ba44cee3ea571e813721e64184172" - }, - "clipr": { - "Package": "clipr", - "Version": "0.7.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ebaa97ac99cc2daf04e77eecc7b781d7" - }, - "cluster": { - "Package": "cluster", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ce49bfe5bc0b3ecd43a01fe1b01c2243" - }, - "coda": { - "Package": "coda", - "Version": "0.19-4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "24b6d006b8b2343876cf230687546932" - }, - "codetools": { - "Package": "codetools", - "Version": "0.2-18", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "019388fc48e48b3da0d3a76ff94608a8" - }, - "colorspace": { - "Package": "colorspace", - "Version": "2.0-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6cab523af06ac301e7a40c5529d45882" - }, - "commonmark": { - "Package": "commonmark", - "Version": "1.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0f22be39ec1d141fd03683c06f3a6e67" - }, - "conquer": { - "Package": "conquer", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a31720f692920e635ecef0481d478247" - }, - "corrplot": { - "Package": "corrplot", - "Version": "0.89", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "98960b099023f7d04dd5a46bd4ff5d45" - }, - "cowplot": { - "Package": "cowplot", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b418e8423699d11c7f2087c2bfd07da2" - }, - "cpp11": { - "Package": "cpp11", - "Version": "0.2.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "730eebcc741a5c36761f7d4d0f5e37b8" - }, - "crayon": { - "Package": "crayon", - "Version": "1.4.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e75525c55c70e5f4f78c9960a4b402e9" - }, - "crosstalk": { - "Package": "crosstalk", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2b06f9e415a62b6762e4b8098d2aecbc" - }, - "curl": { - "Package": "curl", - "Version": "4.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c5e68405893f030f139f6d6675eac675" - }, - "data.table": { - "Package": "data.table", - "Version": "1.14.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d1b8b1a821ee564a3515fa6c6d5c52dc" - }, - "deldir": { - "Package": "deldir", - "Version": "0.2-10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6ba6a411bdd4c1b297bd54e2c5c98385" - }, - "dendextend": { - "Package": "dendextend", - "Version": "1.15.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7f9ef29016a3d840bbd92f879c7cb67b" - }, - "digest": { - "Package": "digest", - "Version": "0.6.27", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a0cbe758a531d054b537d16dff4d58a1" - }, - "dplyr": { - "Package": "dplyr", - "Version": "1.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "19e84500b64bc7e589cb1e2550e25832" - }, - "e1071": { - "Package": "e1071", - "Version": "1.7-7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7426a46e210d9f3815ed793e7112f582" - }, - "egg": { - "Package": "egg", - "Version": "0.4.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d958917f7b60c13089ab0c8d17114053" - }, - "ellipsis": { - "Package": "ellipsis", - "Version": "0.3.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" - }, - "evaluate": { - "Package": "evaluate", - "Version": "0.14", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ec8ca05cffcc70569eaaad8469d2a3a7" - }, - "exactRankTests": { - "Package": "exactRankTests", - "Version": "0.8-32", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "01737129563c02c57905189aa3750acf" - }, - "fansi": { - "Package": "fansi", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d447b40982c576a72b779f0a3b3da227" - }, - "farver": { - "Package": "farver", - "Version": "2.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c98eb5133d9cb9e1622b8691487f11bb" - }, - "fastmap": { - "Package": "fastmap", - "Version": "1.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8" - }, - "filehash": { - "Package": "filehash", - "Version": "2.4-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "417af4bf86b11fdc8737a28905a35136" - }, - "forcats": { - "Package": "forcats", - "Version": "0.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "81c3244cab67468aac4c60550832655d" - }, - "foreach": { - "Package": "foreach", - "Version": "1.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e32cfc0973caba11b65b1fa691b4d8c9" - }, - "foreign": { - "Package": "foreign", - "Version": "0.8-81", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "74628ea7a3be5ee8a7b5bb0a8e84882e" - }, - "formatR": { - "Package": "formatR", - "Version": "1.11", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2590a6a868515a69f258640a51b724c9" - }, - "fs": { - "Package": "fs", - "Version": "1.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "44594a07a42e5f91fac9f93fda6d0109" - }, - "fun": { - "Package": "fun", - "Version": "0.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8d5ea146fba89f98fc35b5e59c5f4a42" - }, - "gclus": { - "Package": "gclus", - "Version": "1.3.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8f905e7f70ac42e5b0e39d6ba360dd44" - }, - "generics": { - "Package": "generics", - "Version": "0.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4d243a9c10b00589889fe32314ffd902" - }, - "gganimate": { - "Package": "gganimate", - "Version": "1.0.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "729026083340f1076e622886c5b337b7" - }, - "ggplot2": { - "Package": "ggplot2", - "Version": "3.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3eb6477d01eb5bbdc03f7d5f70f2733e" - }, - "ggpointdensity": { - "Package": "ggpointdensity", - "Version": "0.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8868788d373ea767189d8a5436416e30" - }, - "ggpubr": { - "Package": "ggpubr", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "77089557d374c69db7cb77e65f0d6ab0" - }, - "ggrepel": { - "Package": "ggrepel", - "Version": "0.9.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "08ab869f37e6a7741a64ab9069bcb67d" - }, - "ggsci": { - "Package": "ggsci", - "Version": "2.9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "81ccb8213ed592598210afd10c3a5936" - }, - "ggsignif": { - "Package": "ggsignif", - "Version": "0.6.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6770aac2203800889cccd6aee7f206a7" - }, - "ggtext": { - "Package": "ggtext", - "Version": "0.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "03d8caec959ac70e2d13bad1ac40667c" - }, - "gifski": { - "Package": "gifski", - "Version": "1.4.3-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "73d7566604b51f704a2f33b2efef470c" - }, - "glue": { - "Package": "glue", - "Version": "1.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6efd734b14c6471cfe443345f3e35e29" - }, - "goftest": { - "Package": "goftest", - "Version": "1.2-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3c9209bce1b10900155ea37ce954cf30" - }, - "gplots": { - "Package": "gplots", - "Version": "3.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e65e5d5dea4cbb9ba822dcd782b2ee1f" - }, - "gridExtra": { - "Package": "gridExtra", - "Version": "2.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7d7f283939f563670a697165b2cf5560" - }, - "gridtext": { - "Package": "gridtext", - "Version": "0.1.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5ae1f617531ca2ae244647d9b21b5e74" - }, - "gtable": { - "Package": "gtable", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ac5c6baf7822ce8732b343f14c072c4d" - }, - "gtools": { - "Package": "gtools", - "Version": "3.9.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2ace6c4a06297d0b364e0444384a2b82" - }, - "haven": { - "Package": "haven", - "Version": "2.4.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9ace652bffef34af558eb5d70903ac2f" - }, - "heatmaply": { - "Package": "heatmaply", - "Version": "1.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "271afb1ad657f45c52d765598944a781" - }, - "hexbin": { - "Package": "hexbin", - "Version": "1.28.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "76314b69dc54f8c14204063a2fd6d74a" - }, - "highr": { - "Package": "highr", - "Version": "0.9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8eb36c8125038e648e5d111c0d7b2ed4" - }, - "hms": { - "Package": "hms", - "Version": "1.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e4bf161ccb74a2c1c0e8ac63bbe332b4" - }, - "htmltools": { - "Package": "htmltools", - "Version": "0.5.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "af2c2531e55df5cf230c4b5444fc973c" - }, - "htmlwidgets": { - "Package": "htmlwidgets", - "Version": "1.5.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6fdaa86d0700f8b3e92ee3c445a5a10d" - }, - "httpuv": { - "Package": "httpuv", - "Version": "1.6.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "54344a78aae37bc6ef39b1240969df8e" - }, - "httr": { - "Package": "httr", - "Version": "1.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a525aba14184fec243f9eaec62fbed43" - }, - "igraph": { - "Package": "igraph", - "Version": "1.2.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7b1f856410253d56ea67ad808f7cdff6" - }, - "isoband": { - "Package": "isoband", - "Version": "0.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b2008df40fb297e3fef135c7e8eeec1a" - }, - "iterators": { - "Package": "iterators", - "Version": "1.0.13", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "64778782a89480e9a644f69aad9a2877" - }, - "jpeg": { - "Package": "jpeg", - "Version": "0.1-8.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bc316c003aba520fc73d70ad53b5fc36" - }, - "jquerylib": { - "Package": "jquerylib", - "Version": "0.1.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5aab57a3bd297eee1c1d862735972182" - }, - "jsonlite": { - "Package": "jsonlite", - "Version": "1.7.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "98138e0994d41508c7a6b84a0600cfcb" - }, - "km.ci": { - "Package": "km.ci", - "Version": "0.5-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b6090043f6d0b5ffc447be4b3f2811e9" - }, - "knitr": { - "Package": "knitr", - "Version": "1.33", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0bc1b5da1b0eb07cd4b727e95e9ff0b8" - }, - "labeling": { - "Package": "labeling", - "Version": "0.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3d5108641f47470611a32d0bdf357a72" - }, - "later": { - "Package": "later", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b61890ae77fea19fc8acadd25db70aa4" - }, - "lattice": { - "Package": "lattice", - "Version": "0.20-44", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f36bf1a849d9106dc2af72e501f9de41" - }, - "lazyeval": { - "Package": "lazyeval", - "Version": "0.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d908914ae53b04d4c0c0fd72ecc35370" - }, - "leaflet": { - "Package": "leaflet", - "Version": "2.0.4.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e3d73becdeb92754d27172d278cbf61d" - }, - "leaflet.providers": { - "Package": "leaflet.providers", - "Version": "1.9.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d3082a7beac4a1aeb96100ff06265d7e" - }, - "lifecycle": { - "Package": "lifecycle", - "Version": "1.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3471fb65971f1a7b2d4ae7848cf2db8d" - }, - "lme4": { - "Package": "lme4", - "Version": "1.1-27", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e055d75b424a33fdc8904e5f81263789" - }, - "lmtest": { - "Package": "lmtest", - "Version": "0.9-38", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b0edacc02f7a3dad41a1afc385e929f4" - }, - "lpSolve": { - "Package": "lpSolve", - "Version": "5.6.15", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "90c3bc497e7d5ec9dbb863621be15abb" - }, - "magick": { - "Package": "magick", - "Version": "2.7.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "db36bbb91bf293f0550c51ecbf6f1928" - }, - "magrittr": { - "Package": "magrittr", - "Version": "2.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "41287f1ac7d28a92f0a286ed507928d3" - }, - "manipulateWidget": { - "Package": "manipulateWidget", - "Version": "0.11.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "49db736a0daf02aa8d5040f804db0272" - }, - "maps": { - "Package": "maps", - "Version": "3.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "392212982257ea03c37b63547dc871b4" - }, - "maptools": { - "Package": "maptools", - "Version": "1.1-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "beef5712326b384b1e87ba10c01e18f5" - }, - "markdown": { - "Package": "markdown", - "Version": "1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "61e4a10781dd00d7d81dd06ca9b94e95" - }, - "matrixStats": { - "Package": "matrixStats", - "Version": "0.59.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "45a2fee40a2f1bcad392cbe8a5f10d4f" - }, - "maxstat": { - "Package": "maxstat", - "Version": "0.7-25", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c166f04bd2bbd830ab34b7329104c019" - }, - "mgcv": { - "Package": "mgcv", - "Version": "1.8-36", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "93cc747b0e1ad882a4570463c3575c23" - }, - "mime": { - "Package": "mime", - "Version": "0.10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "26fa77e707223e1ce042b2b5d09993dc" - }, - "miniUI": { - "Package": "miniUI", - "Version": "0.1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "fec5f52652d60615fdb3957b3d74324a" - }, - "minqa": { - "Package": "minqa", - "Version": "1.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "eaee7d2a6f3ed4491df868611cb064cc" - }, - "misc3d": { - "Package": "misc3d", - "Version": "0.9-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a4540e756faacd9167feb536819e74a7" - }, - "munsell": { - "Package": "munsell", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6dfe8bf774944bd5595785e3229d8771" - }, - "mvtnorm": { - "Package": "mvtnorm", - "Version": "1.1-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6f0133c3842aef0394dbd844a21d3f5f" - }, - "network": { - "Package": "network", - "Version": "1.17.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6915109c2c0307dcc4de735bb8900c64" - }, - "nlme": { - "Package": "nlme", - "Version": "3.1-152", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "35de1ce639f20b5e10f7f46260730c65" - }, - "nloptr": { - "Package": "nloptr", - "Version": "1.2.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2737faeee353704efec5afa1e943dd64" - }, - "nnet": { - "Package": "nnet", - "Version": "7.3-16", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3a3dc184000bc9e6c145c4dbde4dd702" - }, - "numDeriv": { - "Package": "numDeriv", - "Version": "2016.8-1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "df58958f293b166e4ab885ebcad90e02" - }, - "openssl": { - "Package": "openssl", - "Version": "1.4.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f4dbc5a47fd93d3415249884d31d6791" - }, - "openxlsx": { - "Package": "openxlsx", - "Version": "4.2.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2253a430965e222d11a2f9277cd34c2e" - }, - "packrat": { - "Package": "packrat", - "Version": "0.6.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0d6cc4c357e7602bb3eee299f4cfc2a5" - }, - "pbkrtest": { - "Package": "pbkrtest", - "Version": "0.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b304ff5955f37b48bd30518faf582929" - }, - "pdftools": { - "Package": "pdftools", - "Version": "3.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b7a8772f77a852ec8fe678644fd5ba6e" - }, - "pillar": { - "Package": "pillar", - "Version": "1.6.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8672ae02bd20f6479bce2d06c7ff1401" - }, - "pkgconfig": { - "Package": "pkgconfig", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "01f28d4278f15c76cddbea05899c5d6f" - }, - "plot3D": { - "Package": "plot3D", - "Version": "1.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "092e8bfd36dc747184cb56e4686f0cd3" - }, - "plotly": { - "Package": "plotly", - "Version": "4.9.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3f385f2cd5c270ea3bbe68cb94f7c558" - }, - "plotrix": { - "Package": "plotrix", - "Version": "3.8-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "cd2248636c86e6716cd7ae086536cecc" - }, - "plyr": { - "Package": "plyr", - "Version": "1.8.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ec0e5ab4e5f851f6ef32cd1d1984957f" - }, - "png": { - "Package": "png", - "Version": "0.1-7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "03b7076c234cb3331288919983326c55" - }, - "polyclip": { - "Package": "polyclip", - "Version": "1.10-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "cb167f328b3ada4ec5cf67a7df4c900a" - }, - "polynom": { - "Package": "polynom", - "Version": "1.4-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c396592ecfe9e75cee1013533efafe34" - }, - "prettyunits": { - "Package": "prettyunits", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "95ef9167b75dde9d2ccc3c7528393e7e" - }, - "processx": { - "Package": "processx", - "Version": "3.5.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0cbca2bc4d16525d009c4dbba156b37c" - }, - "progress": { - "Package": "progress", - "Version": "1.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061" - }, - "promises": { - "Package": "promises", - "Version": "1.2.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4ab2c43adb4d4699cf3690acd378d75d" - }, - "proxy": { - "Package": "proxy", - "Version": "0.4-26", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "50b405c6419e921b9e9360cc9ebbcf2d" - }, - "ps": { - "Package": "ps", - "Version": "1.6.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "32620e2001c1dce1af49c49dccbb9420" - }, - "purrr": { - "Package": "purrr", - "Version": "0.3.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "97def703420c8ab10d8f0e6c72101e02" - }, - "qap": { - "Package": "qap", - "Version": "0.1-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "753e69deffc32851121955ea150ecf8d" - }, - "qpdf": { - "Package": "qpdf", - "Version": "1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5a2907cd44279b5861ac5f813465b5c9" - }, - "quantreg": { - "Package": "quantreg", - "Version": "5.86", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "28692dfa3efea8e19d29347d05f5a489" - }, - "randomForest": { - "Package": "randomForest", - "Version": "4.6-14", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6367ba8128568cc5ebf8082e440948e4" - }, - "rappdirs": { - "Package": "rappdirs", - "Version": "0.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5e3c5dc0b071b21fa128676560dbe94d" - }, - "raster": { - "Package": "raster", - "Version": "3.4-10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "1d6398dd08391629b5438f9de172f038" - }, - "readr": { - "Package": "readr", - "Version": "1.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2639976851f71f330264a9c9c3d43a61" - }, - "readxl": { - "Package": "readxl", - "Version": "1.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "63537c483c2dbec8d9e3183b3735254a" - }, - "registry": { - "Package": "registry", - "Version": "0.5-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "1c9935f4f14c6c096c9c9072ddee59f1" - }, - "rematch": { - "Package": "rematch", - "Version": "1.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c66b930d20bb6d858cd18e1cebcfae5c" - }, - "renv": { - "Package": "renv", - "Version": "0.13.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "079cb1f03ff972b30401ed05623cbe92" - }, - "reshape": { - "Package": "reshape", - "Version": "0.8.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0f4d941129e00ed34a7d192b1da7ccef" - }, - "reshape2": { - "Package": "reshape2", - "Version": "1.4.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb5996d0bd962d214a11140d77589917" - }, - "rgeos": { - "Package": "rgeos", - "Version": "0.5-5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "94a44c3f0d49ceb80c385610696873ca" - }, - "rgl": { - "Package": "rgl", - "Version": "0.106.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b14c98ea1476eb8a384989f205cc6803" - }, - "rio": { - "Package": "rio", - "Version": "0.5.26", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a83d5939c0e7478cdf53da1da16eaedc" - }, - "rlang": { - "Package": "rlang", - "Version": "0.4.11", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "515f341d3affe0de9e4a7f762efb0456" - }, - "rmarkdown": { - "Package": "rmarkdown", - "Version": "2.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f518ba47713f92d0d603eec7c6888faf" - }, - "rpart": { - "Package": "rpart", - "Version": "4.1-15", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9787c1fcb680e655d062e7611cadf78e" - }, - "rsconnect": { - "Package": "rsconnect", - "Version": "0.8.18", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "50b4e52011e335f7d3053cfde69893ba" - }, - "rstatix": { - "Package": "rstatix", - "Version": "0.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "aa020f8efde649badd0b2b5456e942fe" - }, - "rstudioapi": { - "Package": "rstudioapi", - "Version": "0.13", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "06c85365a03fdaf699966cc1d3cf53ea" - }, - "s2": { - "Package": "s2", - "Version": "1.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "02f7d4821a7ca841bbfdf3b7176ce6cf" - }, - "sass": { - "Package": "sass", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "50cf822feb64bb3977bda0b7091be623" - }, - "scales": { - "Package": "scales", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6f76f71042411426ec8df6c54f34e6dd" - }, - "scatterplot3d": { - "Package": "scatterplot3d", - "Version": "0.3-41", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0d3e8c286b735517c2df4ed48848e732" - }, - "seriation": { - "Package": "seriation", - "Version": "1.2-9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d972f50a1404cf4c413f6c3ca29efc59" - }, - "sf": { - "Package": "sf", - "Version": "1.0-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "800804f284ba87cb28cf24fc47fc4e02" - }, - "sgeostat": { - "Package": "sgeostat", - "Version": "1.0-27", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5e7cd74c654e874ff63db2efaaa2c214" - }, - "shiny": { - "Package": "shiny", - "Version": "1.6.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6e3b6ae7fe02b5859e4bb277f218b8ae" - }, - "shinyjs": { - "Package": "shinyjs", - "Version": "2.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9ddfc91d4280eaa34c2103951538976f" - }, - "showtext": { - "Package": "showtext", - "Version": "0.9-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e5dab22dca0b4626733ffca54b81fb6b" - }, - "showtextdb": { - "Package": "showtextdb", - "Version": "3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c12e756cf947e58b0f2c2a520521a5a8" - }, - "signal": { - "Package": "signal", - "Version": "0.7-7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b8f2ef9022ac085add25ae093754e6b3" - }, - "sm": { - "Package": "sm", - "Version": "2.2-5.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4f27b2025944b16393da73c178086b53" - }, - "sna": { - "Package": "sna", - "Version": "2.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a2a44d327eeca6d2550b4c6dcef22e68" - }, - "sourcetools": { - "Package": "sourcetools", - "Version": "0.1.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "947e4e02a79effa5d512473e10f41797" - }, - "sp": { - "Package": "sp", - "Version": "1.4-5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "dfd843ee98246cf932823acf613b05dd" - }, - "spatstat": { - "Package": "spatstat", - "Version": "2.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "74d077c2cc6165f63f2a051386a3cbb7" - }, - "spatstat.core": { - "Package": "spatstat.core", - "Version": "2.1-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6c1e3cc9e7df1bdfd312e4e75339feae" - }, - "spatstat.data": { - "Package": "spatstat.data", - "Version": "2.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4e8002e034d7d0af852b2bbcce851c2e" - }, - "spatstat.geom": { - "Package": "spatstat.geom", - "Version": "2.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a0a2cda8121279a62604dd24b5a4b9d4" - }, - "spatstat.linnet": { - "Package": "spatstat.linnet", - "Version": "2.1-1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f58ed1a852242fae245cda24827130cd" - }, - "spatstat.sparse": { - "Package": "spatstat.sparse", - "Version": "2.0-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "615efff0d33e612b15dc3fc3ba0cc554" - }, - "spatstat.utils": { - "Package": "spatstat.utils", - "Version": "2.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "72200a58cae0d7046e416e6be6d9d322" - }, - "splancs": { - "Package": "splancs", - "Version": "2.01-42", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a9801f8987696046fce34c33e99322b6" - }, - "statnet.common": { - "Package": "statnet.common", - "Version": "4.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "caf9dc2f33cc6ea4b1930cd71ee29d10" - }, - "stringi": { - "Package": "stringi", - "Version": "1.6.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9df5e6f9a7fa11b84adf0429961de66a" - }, - "stringr": { - "Package": "stringr", - "Version": "1.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0759e6b6c0957edb1311028a49a35e76" - }, - "survMisc": { - "Package": "survMisc", - "Version": "0.5.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "566b73db4f3b2f517e707e1c73267325" - }, - "survival": { - "Package": "survival", - "Version": "3.2-11", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f4d706b25d640dbaeb56d9c9b6ce9a22" - }, - "survminer": { - "Package": "survminer", - "Version": "0.4.9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3f29f006a8eb499eff91d8b72325756e" - }, - "svglite": { - "Package": "svglite", - "Version": "2.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8fb6188960bf0f90996ce52f9c2106ac" - }, - "sys": { - "Package": "sys", - "Version": "3.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b227d13e29222b4574486cfcbde077fa" - }, - "sysfonts": { - "Package": "sysfonts", - "Version": "0.8.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6a750650ae5e5ba11b45cb5012bd6167" - }, - "systemfonts": { - "Package": "systemfonts", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f2e17ba09737e2e7e2ec40fc1f9b6e08" - }, - "tensor": { - "Package": "tensor", - "Version": "1.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "25cfab6cf405c15bccf7e69ec39df090" - }, - "tibble": { - "Package": "tibble", - "Version": "3.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "349b40a9f144516d537c875e786ec8b8" - }, - "tidyr": { - "Package": "tidyr", - "Version": "1.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "450d7dfaedde58e28586b854eeece4fa" - }, - "tidyselect": { - "Package": "tidyselect", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7243004a708d06d4716717fa1ff5b2fe" - }, - "tikzDevice": { - "Package": "tikzDevice", - "Version": "0.12.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "78009f10e5ea26a71103c5ad22632fc8" - }, - "tinytex": { - "Package": "tinytex", - "Version": "0.32", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "db9a6f2cf147751322d22c9f6647c7bd" - }, - "transformr": { - "Package": "transformr", - "Version": "0.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d554a72d831cfa946c6fa0bd9f6bc976" - }, - "tripack": { - "Package": "tripack", - "Version": "1.3-9.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f24fc3b5569f9c4137916865b4d50e78" - }, - "tuneR": { - "Package": "tuneR", - "Version": "1.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5bbc623279d70ff9bfa18045bb1411c5" - }, - "tweenr": { - "Package": "tweenr", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6cc663f970a529dbf776f11d5bcd1a2e" - }, - "units": { - "Package": "units", - "Version": "0.7-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e0f85712d5371ab2841f63cdb33fe0f0" - }, - "utf8": { - "Package": "utf8", - "Version": "1.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c3ad47dc6da0751f18ed53c4613e3ac7" - }, - "vcd": { - "Package": "vcd", - "Version": "1.4-8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bfd83643ebd2a3a5758199b612e1428f" - }, - "vctrs": { - "Package": "vctrs", - "Version": "0.3.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ecf749a1b39ea72bd9b51b76292261f1" - }, - "vioplot": { - "Package": "vioplot", - "Version": "0.3.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "16f08c566712103bd1f8d70141590ac2" - }, - "viridis": { - "Package": "viridis", - "Version": "0.6.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "424d1285b7372d39806abb19467e4df4" - }, - "viridisLite": { - "Package": "viridisLite", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "55e157e2aa88161bdb0754218470d204" - }, - "webshot": { - "Package": "webshot", - "Version": "0.5.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e99d80ad34457a4853674e89d5e806de" - }, - "withr": { - "Package": "withr", - "Version": "2.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ad03909b44677f930fa156d47d7a3aeb" - }, - "wk": { - "Package": "wk", - "Version": "0.4.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f7e41a60d8b19cf505ffa06bf578c7bd" - }, - "xfun": { - "Package": "xfun", - "Version": "0.23", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "791a57f43c887111490851dcd166d344" - }, - "xml2": { - "Package": "xml2", - "Version": "1.3.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d4d71a75dd3ea9eb5fa28cc21f9585e2" - }, - "xtable": { - "Package": "xtable", - "Version": "1.8-4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2" - }, - "yaml": { - "Package": "yaml", - "Version": "2.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "2826c5d9efb0a88f657c7a679c7106db" - }, - "zip": { - "Package": "zip", - "Version": "2.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c7eef2996ac270a18c2715c997a727c5" - }, - "zoo": { - "Package": "zoo", - "Version": "1.8-9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "035d1c7c12593038c26fb1c2fd40c4d2" - } - } -} diff --git a/system.Rmd b/system.Rmd index e4f2c65..b2b1670 100644 --- a/system.Rmd +++ b/system.Rmd @@ -142,7 +142,7 @@ ggplot(aes(x = cut, fill = cut), data = diamonds) + (ref:diamonds-polar) 钻石雕琢水平的极坐标条形图:各种雕琢水平下的钻石数量差别很大。 -图 \@ref(fig:diamonds-polar) 是钻石雕琢水平频数的极坐标图,实际上它是一幅条形图,只是把坐标系换成了极坐标而已。每个扇形的高度代表钻石的频数;前面我们观察到雕琢水平最好的钻石在价格上平均而言并不如次一等的钻石,也许是因为大多数钻石都雕琢得很好。尽管极坐标图有其新颖之处,但用扇形表达频数常常会造成信息误导,这一点在 \@ref(subsec:china-vs-us) 小节中我们还会再举例说明,请读者慎用。 +图 \@ref(fig:diamonds-polar) 是钻石雕琢水平频数的极坐标图,实际上它是一幅条形图,只是把坐标系换成了极坐标而已。每个扇形的高度代表钻石的频数;前面我们观察到雕琢水平最好的钻石在价格上平均而言并不如次一等的钻石,也许是因为大多数钻石都雕琢得很好。尽管极坐标图有其新颖之处,但用扇形表达频数常常会造成信息误导。 ### 切片 {#subsec:facet}