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

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

出版者: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
· · · · · · (收起)

读后感

评分

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

评分

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

评分

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

评分

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

评分

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

用户评价

评分

哇,最近终于啃完了这本《R语言实战:数据挖掘、机器学习与统计分析》。说实话,这本书的厚度一开始让我有点望而却步,感觉像是在捧着一本砖头。但一旦翻开,那种沉浸感就来了。它并没有像一些教科书那样枯燥乏味,而是用大量的实际案例来串联起各种复杂的数据处理和分析技术。最让我印象深刻的是它对“R语言核心”部分的讲解,不仅仅是罗列函数,而是深入剖析了R的向量化思想和面向对象编程的特性,这对于我这种有其他编程语言背景的人来说,构建一个清晰的R思维框架至关重要。书中对数据清洗和预处理的章节简直是救命稻草,我的很多日常工作中遇到的 messy data 问题,都能在这找到对应的优雅解决方案。作者似乎深谙数据分析师的痛点,总能在你快要抓狂的时候,提供一个简洁明了的思路。当然,要真正吃透,光看不练是绝对不行的,我几乎是每一章的代码都亲手敲了一遍,尤其是涉及到时间序列分析和复杂的回归模型构建时,那种“原来如此”的豁然开朗感,是阅读其他资料难以替代的。这本书更像是一个实战伙伴,而非冰冷的操作手册。

评分

这本书的叙事节奏处理得相当高明,它巧妙地平衡了理论的严谨性和实战的即时满足感。我尤其欣赏作者对于“数据可视化”的哲学思考。不同于其他书籍只是教你如何调用绘图函数,这本书花了相当的篇幅讨论“如何讲一个好的数据故事”。它强调图形的清晰度、标签的准确性以及色彩的选择对信息传递效率的影响。在我看来,这一点至关重要,因为我们做分析的最终目的,是将复杂的发现转化为决策者能理解的洞察。书中展示了大量“坏图”和“好图”的对比,这种直观的反差效果非常震撼,一下子就提升了我对图形质量的审美标准。当我开始应用书中学到的原则来重构我以前的报告图表时,同事们明显注意到了差异,反馈也变得更加积极,这极大地增强了我的信心。它教会我的不仅仅是技术,更是一种专业态度。

评分

我得说,这本书对“统计模型”的讲解简直是教科书级别的,但又不像教科书那样让人打瞌睡。我之前对贝叶斯统计总是有种雾里看花的感觉,这本书通过一系列循序渐进的例子,把那些复杂的概率公式和实际应用场景完美地结合起来了。它没有回避复杂性,而是直面它,然后用清晰的逻辑帮你层层剥开。比如,它讲解广义线性模型(GLM)时,不是简单地介绍几种分布,而是从泊松回归讲到逻辑回归,中间还穿插了模型诊断的重要性,这让我对“模型选择”这件事有了更深刻的理解,知道什么时候该相信模型,什么时候该保持警惕。更赞的是,它引入了一些前沿的统计方法,比如提升树(Boosting)和随机森林,讲解得既有理论深度,又兼顾了实际操作的可行性,很多我在网上搜了好久都找不到的细节优化技巧,这本书里都有提及。读完这部分,我感觉自己对数据背后驱动的因果关系有了更强的探究欲望,不再满足于跑出一个P值了。

评分

这本书的进阶内容部分,特别是关于高性能计算和并行处理的章节,对我这个经常需要处理海量数据集的分析师来说,简直是雪中送炭。在过去,处理百万行级别的数据集时,我的R脚本经常会因为内存溢出而崩溃,或者运行一晚上都跑不完。这本书系统地介绍了如何利用`data.table`包的高效操作,以及如何借助多核处理来加速计算密集型任务。作者没有仅仅停留在概念层面,而是提供了大量的代码片段和性能对比数据,让人能清晰地看到优化前后的效率差异,这比任何空洞的“要优化”的建议都要有力得多。虽然一开始配置并行环境需要一点耐心,但一旦搭建成功,那种运算速度的飞跃感,真的让人觉得投入的时间是完全值得的。它成功地帮我把R从一个“桌面分析工具”升级成了“企业级数据处理平台”的有力补充。

评分

总的来说,这本书的内容覆盖面极广,从基础的数据结构到高级的机器学习算法,再到高效的数据处理技巧,形成了一个非常闭环的学习路径。我特别喜欢作者在章节末尾设置的“进一步思考”环节,这些问题往往触及了当前数据科学领域的热点和难点,促使读者跳出书本的框架,去探索更广阔的知识海洋。它不仅仅是一本工具书,更像是一个资深导师在身边指导你成长。我身边不少同事都在用不同的编程语言,但这本书所强调的分析思维——严谨的假设检验、对模型局限性的清醒认识、以及对结果的可解释性追求——是跨越语言的通用准则。如果你想系统、深入且实战性地掌握现代数据分析的全貌,这本书绝对是值得反复翻阅的珍藏版。它让我对自己的职业能力边界有了更清晰的认知,并且提供了明确的提升路径。

评分

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

评分

R4DS里面四步骤的data visualization。当技术手册,不断练习、不断返回来查。

评分

就像书名里的小字所述:elegant graphic。R 的这个包实在太优雅了。之前断断续续一直有用到R做可视化,但很多点都是零散的,这本书很全面,可帮助系统理解可视化流程和ggolot2的基本逻辑。(有点后悔论文没用R写...)

评分

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

评分

自己一点点摸索完了才系统扫了遍这本书,本应该早点看的。。。

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

© 2026 book.wenda123.org All Rights Reserved. 图书目录大全 版权所有