ggplot2: Elegant Graphics for Data Analysis (Use R!)

ggplot2: Elegant Graphics for Data Analysis (Use R!) pdf epub mobi txt 电子书 下载 2025

出版者:Springer
作者:Hadley Wickham
出品人:
页数:260
译者:
出版时间:2016-6-16
价格:USD 48.21
装帧:Paperback
isbn号码:9783319242750
丛书系列:
图书标签:
  • R
  • 数据可视化
  • 统计
  • 数据分析
  • 数据处理
  • 英文版
  • 英文
  • 编程
  • R
  • ggplot2
  • 数据可视化
  • 统计图形
  • 数据分析
  • 图形绘制
  • R语言
  • 数据科学
  • 信息图表
  • 可视化
  • 编程
想要找书就要到 小美书屋
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

This new edition to the classic book by ggplot2 creator Hadley Wickham highlights compatibility with knitr and RStudio. ggplot2 is a data visualization package for R that helps users create data graphics, including those that are multi-layered, with ease. With ggplot2, it's easy to:

produce handsome, publication-quality plots with automatic legends created from the plot specification

superimpose multiple layers (points, lines, maps, tiles, box plots) from different data sources with automatically adjusted common scales

add customizable smoothers that use powerful modeling capabilities of R, such as loess, linear models, generalized additive models, and robust regression

save any ggplot2 plot (or part thereof) for later modification or reuse

create custom themes that capture in-house or journal style requirements and that can easily be applied to multiple plots

approach a graph from a visual perspective, thinking about how each component of the data is represented on the final plot

This book will be useful to everyone who has struggled with displaying data in an informative and attractive way. Some basic knowledge of R is necessary (e.g., importing data into R). ggplot2 is a mini-language specifically tailored for producing graphics, and you'll learn everything you need in the book. After reading this book you'll be able to produce graphics customized precisely for your problems, and you'll find it easy to get graphics out of your head and on to the screen or page.

作者简介

Hadley is Chief Scientist at RStudio. He is interested in building better tools for data science. His work includes R packages for data analysis (ggplot2, dplyr, tidyr); packages that make R less frustrating (lubridate for dates, stringr for strings, httr for accessing web APIs); and that make it easier to do good software development in R (roxygen2, testthat, devtools). He is also a writer, educator, and frequent contributor to conferences promoting more accessible and more effective data analysis.

目录信息

Part I Getting Started
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Welcome to ggplot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 What Is the Grammar of Graphics? . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 How Does ggplot2 Fit in with Other R Graphics?. . . . . . . . . . . 5
1.4 About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Other Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Colophon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2 Getting Started with ggplot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Fuel Economy Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Key Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4 Colour, Size, Shape and Other Aesthetic Attributes . . . . . . . . . 14
2.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6 Plot Geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6.1 Adding a Smoother to a Plot . . . . . . . . . . . . . . . . . . . . . . 18
2.6.2 Boxplots and Jittered Points . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.3 Histograms and Frequency Polygons . . . . . . . . . . . . . . . . 22
2.6.4 Bar Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.6.5 Time Series with Line and Path Plots . . . . . . . . . . . . . . . 25
2.6.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.7 Modifying the Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.8 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.9 Quick Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3 Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Basic Plot Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4 Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5 Collective Geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.5.1 Multiple Groups, One Aesthetic . . . . . . . . . . . . . . . . . . . . 46
3.5.2 Different Groups on Different Layers . . . . . . . . . . . . . . . . 47
3.5.3 Overriding the Default Grouping . . . . . . . . . . . . . . . . . . . 49
3.5.4 Matching Aesthetics to Graphic Objects. . . . . . . . . . . . . 50
3.5.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6 Surface Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.7 Drawing Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.7.1 Vector Boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.7.2 Point Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.7.3 Raster Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7.4 Area Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.8 Revealing Uncertainty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.9 Weighted Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.10 Diamonds Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.11 Displaying Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.11.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.12 Dealing with Overplotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.13 Statistical Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.14 Add-on Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Part II The Grammar
4 Mastering the Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.2 Building a Scatterplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.2.1 Mapping Aesthetics to Data . . . . . . . . . . . . . . . . . . . . . . . 78
4.2.2 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.3 Adding Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.4 Components of the Layered Grammar . . . . . . . . . . . . . . . . . . . . . 83
4.4.1 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.4.2 Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.4.3 Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.4.4 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5 Build a Plot Layer by Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.2 Building a Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.4 Aesthetic Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.4.1 Specifying the Aesthetics in the Plot vs. in the Layers. 95
5.4.2 Setting vs. Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.5 Geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.6 Stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.6.1 Generated Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.6.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.7 Position Adjustments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.7.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6 Scales, Axes and Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.2 Modifying Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6.3 Guides: Legends and Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6.3.1 Scale Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.3.2 Breaks and Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.4 Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4.1 Layers and Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4.2 Legend Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.4.3 Guide Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.5 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6 Scales Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6.1 Continuous Position Scales . . . . . . . . . . . . . . . . . . . . . . . . 130
6.6.2 Colour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.6.3 The Manual Discrete Scale . . . . . . . . . . . . . . . . . . . . . . . . 141
6.6.4 The Identity Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
6.6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
7 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.2 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.2.1 Facet Wrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
7.2.2 Facet Grid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
7.2.3 Controlling Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
7.2.4 Missing Facetting Variables . . . . . . . . . . . . . . . . . . . . . . . . 154
7.2.5 Grouping vs. Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
7.2.6 Continuous Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
7.2.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.3 Coordinate Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.4 Linear Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
7.4.1 Zooming into a Plot with coord cartesian() . . . . . . . . . . 160
7.4.2 Flipping the Axes with coord flip() . . . . . . . . . . . . . . . . 161
7.4.3 Equal Scales with coord fixed() . . . . . . . . . . . . . . . . . . . 162
7.5 Non-linear Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7.5.1 Transformations with coord trans() . . . . . . . . . . . . . . . . 165
7.5.2 Polar Coordinates with coord polar() . . . . . . . . . . . . . . 166
7.5.3 Map Projections with coord map() . . . . . . . . . . . . . . . . . 167
8 Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.2 Complete Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
8.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
8.3 Modifying Theme Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
8.4 Theme Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8.4.1 Plot Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8.4.2 Axis Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.4.3 Legend Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
8.4.4 Panel Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.4.5 Facetting Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
8.5 Saving Your Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Part III Data Analysis
9 DataAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.2 Tidy Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
9.3 Spread and Gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
9.3.1 Gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.3.2 Spread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
9.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
9.4 Separate and Unite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
9.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
9.5 Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
9.5.1 Blood Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.5.2 Test Scores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.6 Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
10 Data Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
10.2 Filter Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
10.2.1 Useful Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
10.2.2 Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
10.2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
10.3 Create New Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
10.3.1 Useful Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
10.3.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.4 Group-wise Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.4.1 Useful Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
10.4.2 Statistical Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . 214
10.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
10.5 Transformation Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
10.6 Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11 Modelling for Visualisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.2 Removing Trend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.3 Texas Housing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.4 Visualising Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.5 Model-Level Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.6 Coefficient-Level Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.6.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
11.7 Observation Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
11.7.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
12 Programming with ggplot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
12.2 Single Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
12.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
12.3 Multiple Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
12.3.1 Plot Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
12.3.2 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
12.3.3 Additional Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
12.3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
12.4 Plot Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
12.4.1 Indirectly Referring to Variables . . . . . . . . . . . . . . . . . . . . 249
12.4.2 The Plot Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
12.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
12.5 Functional Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
12.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
R Code index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
· · · · · · (收起)

读后感

评分

很适合R语言的初学者,书中有大量的例子,也可以下载带源代码。将ggplot2的基本原理和操作讲解的还是很清楚的。真是佩服大神Hadley Wickham, 长的帅(耳钉很漂亮),将R的可操作性提高了一大截。但要想学好R的画图,光着一本是远远不够的。  

评分

我看了一遍多一点,有点看不下去了,真的有点想吐的感觉,可能跟我这两天的心态有一定关系。但我师兄说,他当时看的是英文版,直到第5遍,他才慢慢地开始懂了,好吧,我要向他学习。 什么评论太短了,好吧,我再多啰嗦几句。 现在是试着做些笔记,想着尽量从更加系统、更加宏观...  

评分

没想到人生第一个推文居然被Hadley大神翻牌了~ 这本书(第二版)主要有三部分: Part I: Getting Started,相当于Introduction,简单介绍ggplot2可以干哪些事; Part II: The Grammar,全书的精华,详细介绍了ggplot2背后的原理; Part III: Data Analysis,这部分在第三版中...  

评分

我读晚了。 网上有很多关于ggplot2的教程,大多不够系统,有很多原理上的东西没讲清楚。不知道原理的后果就是每次要做不太一样的图的时候,就要GOOGLE具体的图怎么画,因为不能理解图的生成过程和图的组成部件。这本书是ggplot的最初的开发者写的,不仅用很多例子讲了怎么用gg...  

评分

首先,从 qplot 入门并不是说完全没有必要,做一个引子还是可以的,但是它又引入了太多的细节,然而又没有细讲,也没有说后面第几章会 cover 到这部分的内容,使得第二章读起来异常痛苦,时常需要停下来 google。其实后面都有讲,从而这本书其实是越读越快的,只是体验有点糟糕...  

用户评价

评分

查表吧,之前傻傻当教材读,想什么呢

评分

第三版在线免费:https://ggplot2-book.org

评分

在读这本书读的那一周连着下了两天雨,然后我看着雨和打伞的人,脑子里就一直冒geom_rain, geom_umbrella。适合不适合初学者我不知道,反正放我这儿我没从头开始,是复习了一下datacamp上学的东西,整理了一下自己google来的野路子。算是受用了。

评分

牛逼了!就是书太老了2009年的,好多函数都过期被清理掉了,ggplot又一直在更新的函数,以及作者作为开发者,讲了很多很牛逼但是我们一点都不care的东西。 最大的优点就是图多!看不懂就看图!

评分

睡前读物,拿着hadley送我的签名本,很愉快地看完了。

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美书屋 版权所有