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
· · · · · · (收起)

讀後感

評分

如果仅仅想画几张图,其实更推荐G graphics cookbook. 如果想了解ggplot2后面的原理,满足自己画自己特别的图,推荐看这本书。 这本书对ggplot2后的理论,数据结构,画图顺序都有介绍。 英文有些单词不是很好理解,不过硬着头皮多看几遍,也都能基本明白,想全明白还得靠以...  

評分

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

評分

如果仅仅想画几张图,其实更推荐G graphics cookbook. 如果想了解ggplot2后面的原理,满足自己画自己特别的图,推荐看这本书。 这本书对ggplot2后的理论,数据结构,画图顺序都有介绍。 英文有些单词不是很好理解,不过硬着头皮多看几遍,也都能基本明白,想全明白还得靠以...  

評分

觉得R语言作图一直欠缺着什么,直到ggplot2包和文档的出现,这本书是翻译版,其实用心看下去,内容不多,需要你自己慢慢研究慢慢拓展慢慢创新。ggplot2是R语言做数据可视化的瑞士军刀,优雅,美丽!

評分

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

用戶評價

评分

就像書名裏的小字所述:elegant graphic。R 的這個包實在太優雅瞭。之前斷斷續續一直有用到R做可視化,但很多點都是零散的,這本書很全麵,可幫助係統理解可視化流程和ggolot2的基本邏輯。(有點後悔論文沒用R寫...)

评分

查錶吧,之前傻傻當教材讀,想什麼呢

评分

熟悉R的人可以直接讀 Part II the Grammer 部分

评分

簡潔實用!

评分

第三版在綫免費:https://ggplot2-book.org

本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度google,bing,sogou

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