100% found this document useful (4 votes)
17 views

ggplot2 Elegant Graphics For Data Analysis Second Edition Hadley Wickham download

Ebook download

Uploaded by

hamorwaldoeh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
17 views

ggplot2 Elegant Graphics For Data Analysis Second Edition Hadley Wickham download

Ebook download

Uploaded by

hamorwaldoeh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

ggplot2 Elegant Graphics For Data Analysis

Second Edition Hadley Wickham pdf download

https://textbookfull.com/product/ggplot2-elegant-graphics-for-
data-analysis-second-edition-hadley-wickham/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

ggplot2 Elegant Graphics For Data Analysis Second


Edition Hadley Wickham Carson Sievert

https://textbookfull.com/product/ggplot2-elegant-graphics-for-
data-analysis-second-edition-hadley-wickham-carson-sievert/

Advanced R (Second Edition) Hadley Wickham

https://textbookfull.com/product/advanced-r-second-edition-
hadley-wickham/

Visualizing Data in R 4 Graphics Using the base


graphics stats and ggplot2 Packages 1st Edition Margot
Tollefson

https://textbookfull.com/product/visualizing-data-
in-r-4-graphics-using-the-base-graphics-stats-and-
ggplot2-packages-1st-edition-margot-tollefson/

R Cookbook Proven Recipes for Data Analysis Statistics


and Graphics Jd Long

https://textbookfull.com/product/r-cookbook-proven-recipes-for-
data-analysis-statistics-and-graphics-jd-long/
Using R and RStudio for Data Management Statistical
Analysis and Graphics 2nd Edition Nicholas J. Horton

https://textbookfull.com/product/using-r-and-rstudio-for-data-
management-statistical-analysis-and-graphics-2nd-edition-
nicholas-j-horton/

Fluid Simulation for Computer Graphics Second Edition


Bridson

https://textbookfull.com/product/fluid-simulation-for-computer-
graphics-second-edition-bridson/

Analysis of Binary Data, Second Edition David Roxbee


Cox

https://textbookfull.com/product/analysis-of-binary-data-second-
edition-david-roxbee-cox/

R Graphics Cookbook Practical Recipes for Visualizing


Data 2nd Edition Winston Chang

https://textbookfull.com/product/r-graphics-cookbook-practical-
recipes-for-visualizing-data-2nd-edition-winston-chang/

R in Action Data Analysis and Graphics with R Bonus ch


23 ONLY 2nd Edition Robert Kabacoff

https://textbookfull.com/product/r-in-action-data-analysis-and-
graphics-with-r-bonus-ch-23-only-2nd-edition-robert-kabacoff/
Hadley Wickham

ggplot2
Elegant Graphics for Data Analysis

October 15, 2015

Springer
To my parents, Alison & Brian Wickham.
Without them and their unconditional love
and support, none of this would’ve been
possible.
Preface

Welcome to the second edition of “ggplot2: elegant graphics for data analysis”.
I’m so excited to have an updated book that shows off all the latest and
greatest ggplot2 features, as well as the great things that have been happening
in R and in the ggplot2 community the last five years. The ggplot2 community
is vibrant: the ggplot2 mailing list has over 7,000 members and there is a very
active Stack Overflow community, with nearly 10,000 questions tagged with
ggplot2. While most of my development effort is no longer going into ggplot2
(more on that below), there’s never been a better time to learn it and use it.
I am tremendously grateful for the success of ggplot2. It’s one of the most
commonly downloaded R packages (over a million downloads in the last year!)
and has influenced the design of graphics packages for other languages. Per-
sonally, ggplot2 has bought me many exciting opportunities to travel the
world and meet interesting people. I love hearing how people are using R and
ggplot2 to understand the data that they love.
A big thanks for this edition goes to Carson Sievert, who helped me mod-
ernise the code, including converting the sources to Rmarkdown. He also
updated many of the examples and helped me proofread the book.

Major changes

I’ve spent a lot of effort ensuring that this edition is a true upgrade over the
first edition. As well as updating the code everywhere to make sure it’s fully
compatible with the latest version of ggplot2, I have:

• Shown much more code in the book, so it’s easier to use as a reference.
Overall the book has a more “knitr”-ish sensibility: there are fewer floating
figures and tables, and more inline code. This makes the layout a little less
pretty but keeps related items closer together. You can find the complete
source online at https://github.com/hadley/ggplot2-book.

ix
x Preface

• Switched from qplot() to ggplot() in the introduction, Chapter 2. Feed-


back indicated that qplot() was a crutch: it makes simple plots a little
easier, but it doesn’t help with mastering the grammar.
• Added practice exercises throughout the book so you can practice new
techniques immediately after learning about them.
• Added pointers to the rich ecosystem of packages that have built up around
ggplot2. You’ll now see a number of other packages highlighted in the book,
and get pointers to other packages I think are particularly useful.
• Overhauled the toolbox chapter, Chapter 3, to cover all the new geoms.
I’ve added a completely new section on text labels, Section 3.3, since it’s
important and not covered in detail elsewhere. The mapping section, Sec-
tion 3.7, has been considerably expanded to talk more about the different
types of map data, and where you might find it.
• Completely rewritten the scales chapter, Chapter 6, to focus on the most
important tasks. It also discusses the new features that give finer control
over legend appearance, Section 6.4, and shows off some of the new scales
added to ggplot2, Section 6.6.
• Split the data analysis chapter into three pieces: data tidying (with tidyr),
Chapter 9; data manipulation (with dplyr), Chapter 10; and model visual-
isation (with broom), Chapter 11. I discuss the latest iteration of my data
manipulation tools, and introduce the fantastic broom package by David
Robinson.

The book is accompanied by a new version of ggplot2: version 1.1.0. This


includes a number of minor tweaks and improvements, and considerable im-
provements to the documentation. Coming back to ggplot2 development after
a considerable pause has helped me to see many problems that previously es-
caped notice. ggplot2 1.1.0 (finally!) contains an official extension mechanism
so that others can contribute new ggplot2 components in their own packages.
This is documented in a new vignette, vignette("extending-ggplot2").

The future

ggplot2 is now stable, and is unlikely to change much in the future. There will
be bug fixes and there may be new geoms, but there will be no large changes to
how ggplot2 works. The next iteration of ggplot2 is ggvis. ggvis is significantly
more ambitious because it aims to provide a grammar of interactive graphics.
ggvis is still young, and lacks many of the features of ggplot2 (most notably
it currently lacks facetting and has no way to make static graphics), but over
the coming years the goal is for ggvis to be better than ggplot2.
The syntax of ggvis is a little different to ggplot2. You won’t be able
to trivially convert your ggplot2 plots to ggvis, but we think the cost is
worth it: the new syntax is considerably more consistent, and will be easier
Preface xi

for newcomers to learn. If you’ve mastered ggplot2, you’ll find your skills
transfer very well to ggvis and after struggling with the syntax for a while, it
will start to feel quite natural. The important skills you learn when mastering
ggplot2 are not the programmatic details of describing a plot in code, but
the much harder challenge of thinking about how to turn data into effective
visualisations.

Acknowledgements

Many people have contributed to this book with high-level structural in-
sights, spelling and grammar corrections and bug reports. I’d particularly
like to thank Alexander Forrence, Devin Pastoor, David Robinson, and
Guangchuang Yu, for their detailed technical review of the book.
Many others have contributed over the (now quite long!) lifetime of gg-
plot2. I would like to thank: Leland Wilkinson, for discussions and comments
that cemented my understanding of the grammar; Gabor Grothendieck, for
early helpful comments; Heike Hofmann and Di Cook, for being great advi-
sors and supporting the development of ggplot2 during my PhD; Charlotte
Wickham; the students of stat480 and stat503 at ISU, for trying it out when
it was very young; Debby Swayne, for masses of helpful feedback and advice;
Bob Muenchen, Reinhold Kliegl, Philipp Pagel, Richard Stahlhut, Baptiste
Auguie, Jean-Olivier Irisson, Thierry Onkelinx and the many others who have
read draft versions of the book and given me feedback; and last, but not least,
the members of R-help and the ggplot2 mailing list, for providing the many
interesting and challenging graphics problems that have helped motivate this
book.

Hadley Wickham
September 2015
Contents

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? . . . . . . . . . . . . . 6
1.4 About this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Other resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Colophon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2 Getting started with ggplot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Fuel economy data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Key components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Colour, size, shape and other aesthetic attributes . . . . . . . . . . . 16
2.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6 Plot geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.1 Adding a smoother to a plot . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.2 Boxplots and jittered points . . . . . . . . . . . . . . . . . . . . . . . 23
2.6.3 Histograms and frequency polygons . . . . . . . . . . . . . . . . . 24
2.6.4 Bar charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.5 Time series with line and path plots . . . . . . . . . . . . . . . . 27
2.6.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7 Modifying the axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

xiii
xiv Contents

2.9 Quick plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3 Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Basic plot types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.4 Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5 Collective geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.5.1 Multiple groups, one aesthetic . . . . . . . . . . . . . . . . . . . . . 48
3.5.2 Different groups on different layers . . . . . . . . . . . . . . . . . . 49
3.5.3 Overriding the default grouping . . . . . . . . . . . . . . . . . . . . 51
3.5.4 Matching aesthetics to graphic objects . . . . . . . . . . . . . . 52
3.5.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6 Surface plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7 Drawing maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.7.1 Vector boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.7.2 Point metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7.3 Raster images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.7.4 Area metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.8 Revealing uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.9 Weighted data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.10 Diamonds data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.11 Displaying distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.11.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.12 Dealing with overplotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.13 Statistical summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.14 Add-on packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Part II The Grammar

4 Mastering the grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.2 Building a scatterplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.2.1 Mapping aesthetics to data . . . . . . . . . . . . . . . . . . . . . . . . 82
4.2.2 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.3 Adding complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.4 Components of the layered grammar . . . . . . . . . . . . . . . . . . . . . . 87
4.4.1 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.4.2 Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.4.3 Coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4.4.4 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Contents xv

5 Build a plot layer by layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93


5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.2 Building a plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.3 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.4 Aesthetic mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.4.1 Specifying the aesthetics in the plot vs. in the layers . . 99
5.4.2 Setting vs. mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.5 Geoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.6 Stats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5.6.1 Generated variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.6.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.7 Position adjustments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.7.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

6 Scales, axes and legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113


6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.2 Modifying scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.3 Guides: legends and axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.3.1 Scale title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
6.3.2 Breaks and labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.4 Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.4.1 Layers and legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.4.2 Legend layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.4.3 Guide functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.5 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.6 Scales toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.6.1 Continuous position scales . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.6.2 Colour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.6.3 The manual discrete scale . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.6.4 The identity scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
6.6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

7 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
7.2 Facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
7.2.1 Facet wrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
7.2.2 Facet grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
xvi Contents

7.2.3 Controlling scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153


7.2.4 Missing facetting variables . . . . . . . . . . . . . . . . . . . . . . . . . 156
7.2.5 Grouping vs. facetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
7.2.6 Continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.2.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.3 Coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.4 Linear coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7.4.1 Zooming into a plot with coord_cartesian() . . . . . . . . . . 162
7.4.2 Flipping the axes with coord_flip() . . . . . . . . . . . . . . . . 163
7.4.3 Equal scales with coord_fixed() . . . . . . . . . . . . . . . . . . . . 164
7.5 Non-linear coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
7.5.1 Transformations with coord_trans() . . . . . . . . . . . . . . . . 167
7.5.2 Polar coordinates with coord_polar() . . . . . . . . . . . . . . . 169
7.5.3 Map projections with coord_map() . . . . . . . . . . . . . . . . . . 169

8 Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
8.2 Complete themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
8.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
8.3 Modifying theme components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.4 Theme elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.4.1 Plot elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.4.2 Axis elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.4.3 Legend elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
8.4.4 Panel elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.4.5 Facetting elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.5 Saving your output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

Part III Data analysis

9 Data analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193


9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
9.2 Tidy data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
9.3 Spread and gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
9.3.1 Gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
9.3.2 Spread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
9.4 Separate and unite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
9.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
9.5 Case studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
9.5.1 Blood pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
9.5.2 Test scores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
9.6 Learning more . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Contents xvii

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

10 Data transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207


10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
10.2 Filter observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
10.2.1 Useful tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
10.2.2 Missing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
10.3 Create new variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
10.3.1 Useful tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.3.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
10.4 Group-wise summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
10.4.1 Useful tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.4.2 Statistical considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 219
10.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
10.5 Transformation pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
10.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
10.6 Learning more . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

11 Modelling for visualisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227


11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.2 Removing trend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.3 Texas housing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.4 Visualising models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
11.5 Model-level summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
11.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
11.6 Coefficient-level summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
11.6.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
11.7 Observation data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11.7.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

12 Programming with ggplot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249


12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
12.2 Single components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
12.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
12.3 Multiple components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
12.3.1 Plot components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.3.2 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.3.3 Additional arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
12.3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
12.4 Plot functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
xviii Contents

12.4.1 Indirectly referring to variables . . . . . . . . . . . . . . . . . . . . . 257


12.4.2 The plot environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
12.4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
12.5 Functional programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
12.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263

Code index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266


Part I
Getting started
Chapter 1
Introduction

1.1 Welcome to ggplot2

ggplot2 is an R package for producing statistical, or data, graphics, but it is


unlike most other graphics packages because it has a deep underlying gram-
mar. This grammar, based on the Grammar of Graphics (Wilkinson 2005),
is made up of a set of independent components that can be composed in
many different ways. This makes ggplot2 very powerful because you are not
limited to a set of pre-specified graphics, but you can create new graphics
that are precisely tailored for your problem. This may sound overwhelming,
but because there is a simple set of core principles and very few special cases,
ggplot2 is also easy to learn (although it may take a little time to forget your
preconceptions from other graphics tools).
Practically, ggplot2 provides beautiful, hassle-free plots that take care of
fiddly details like drawing legends. The plots can be built up iteratively and
edited later. A carefully chosen set of defaults means that most of the time
you can produce a publication-quality graphic in seconds, but if you do have
special formatting requirements, a comprehensive theming system makes it
easy to do what you want. Instead of spending time making your graph look
pretty, you can focus on creating a graph that best reveals the messages in
your data.
ggplot2 is designed to work iteratively. You can start with a layer showing
the raw data then add layers of annotations and statistical summaries. It
allows you to produce graphics using the same structured thinking that you
use to design an analysis, reducing the distance between a plot in your head
and one on the page. It is especially helpful for students who have not yet
developed the structured approach to analysis used by experts.
Learning the grammar not only will help you create graphics that you know
about now, but will also help you to think about new graphics that would
be even better. Without the grammar, there is no underlying theory, so most
graphics packages are just a big collection of special cases. For example, in

3
4 1 Introduction

base R, if you design a new graphic, it’s composed of raw plot elements like
points and lines, and it’s hard to design new components that combine with
existing plots. In ggplot2, the expressions used to create a new graphic are
composed of higher-level elements like representations of the raw data and
statistical transformations, and can easily be combined with new datasets
and other plots.
This book provides a hands-on introduction to ggplot2 with lots of ex-
ample code and graphics. It also explains the grammar on which ggplot2 is
based. Like other formal systems, ggplot2 is useful even when you don’t un-
derstand the underlying model. However, the more you learn about it, the
more effectively you’ll be able to use ggplot2. This book assumes some basic
familiarity with R, to the level described in the first chapter of Dalgaard’s
Introductory Statistics with R.
This book will introduce you to ggplot2 as a novice, unfamiliar with the
grammar; teach you the basics so that you can re-create plots you are already
familiar with; show you how to use the grammar to create new types of graph-
ics; and eventually turn you into an expert who can build new components
to extend the grammar.

1.2 What is the grammar of graphics?

Wilkinson (2005) created the grammar of graphics to describe the deep fea-
tures that underlie all statistical graphics. The grammar of graphics is an
answer to a question: what is a statistical graphic? The layered grammar of
graphics (Wickham 2009) builds on Wilkinson’s grammar, focussing on the
primacy of layers and adapting it for embedding within R. In brief, the gram-
mar tells us that a statistical graphic is a mapping from data to aesthetic
attributes (colour, shape, size) of geometric objects (points, lines, bars). The
plot may also contain statistical transformations of the data and is drawn on
a specific coordinate system. Facetting can be used to generate the same plot
for different subsets of the dataset. It is the combination of these independent
components that make up a graphic.
As the book progresses, the formal grammar will be explained in increasing
detail. The first description of the components follows below. It introduces
some of the terminology that will be used throughout the book and outlines
the basic responsibilities of each component. Don’t worry if it doesn’t all make
sense right away: you will have many more opportunities to learn about the
pieces and how they fit together.
All plots are composed of:
• Data that you want to visualise and a set of aesthetic mappings describ-
ing how variables in the data are mapped to aesthetic attributes that you
can perceive.
1.2 What is the grammar of graphics? 5

• Layers made up of geometric elements and statistical transformation.


Geometric objects, geoms for short, represent what you actually see on
the plot: points, lines, polygons, etc. Statistical transformations, stats for
short, summarise data in many useful ways. For example, binning and
counting observations to create a histogram, or summarising a 2d rela-
tionship with a linear model.
• The scales map values in the data space to values in an aesthetic space,
whether it be colour, or size, or shape. Scales draw a legend or axes, which
provide an inverse mapping to make it possible to read the original data
values from the plot.
• A coordinate system, coord for short, describes how data coordinates are
mapped to the plane of the graphic. It also provides axes and gridlines to
make it possible to read the graph. We normally use a Cartesian coordinate
system, but a number of others are available, including polar coordinates
and map projections.
• A faceting specification describes how to break up the data into subsets
and how to display those subsets as small multiples. This is also known as
conditioning or latticing/trellising.
• A theme which controls the finer points of display, like the font size and
background colour. While the defaults in ggplot2 have been chosen with
care, you may need to consult other references to create an attractive plot.
A good starting place is Tufte’s early works (Tufte 1990; Tufte 1997; Tufte
2001).
It is also important to talk about what the grammar doesn’t do:

• It doesn’t suggest what graphics you should use to answer the questions
you are interested in. While this book endeavours to promote a sensible
process for producing plots of data, the focus of the book is on how to
produce the plots you want, not knowing what plots to produce. For more
advice on this topic, you may want to consult Robbins (2004), Cleveland
(1993), Chambers et al. (1983), and J. W. Tukey (1977).
• It does not describe interactivity: the grammar of graphics describes only
static graphics and there is essentially no benefit to displaying them on
a computer screen as opposed to a piece of paper. ggplot2 can only cre-
ate static graphics, so for dynamic and interactive graphics you will have
to look elsewhere (perhaps at ggvis, described below). Cook and Swayne
(2007) provides an excellent introduction to the interactive graphics pack-
age GGobi. GGobi can be connected to R with the rggobi package (Wick-
ham et al. 2008).
6 1 Introduction

1.3 How does ggplot2 fit in with other R graphics?

There are a number of other graphics systems available in R: base graphics,


grid graphics and trellis/lattice graphics. How does ggplot2 differ from them?

• Base graphics were written by Ross Ihaka based on experience implement-


ing the S graphics driver and partly looking at Chambers et al. (1983).
Base graphics has a pen on paper model: you can only draw on top of the
plot, you cannot modify or delete existing content. There is no (user acces-
sible) representation of the graphics, apart from their appearance on the
screen. Base graphics includes both tools for drawing primitives and entire
plots. Base graphics functions are generally fast, but have limited scope.
If you’ve created a single scatterplot, or histogram, or a set of boxplots in
the past, you’ve probably used base graphics.
• The development of “grid” graphics, a much richer system of graphical
primitives, started in 2000. Grid is developed by Paul Murrell, growing
out of his PhD work (Murrell 1998). Grid grobs (graphical objects) can
be represented independently of the plot and modified later. A system of
viewports (each containing its own coordinate system) makes it easier to
lay out complex graphics. Grid provides drawing primitives, but no tools
for producing statistical graphics.
• The lattice package, developed by Deepayan Sarkar, uses grid graphics to
implement the trellis graphics system of Cleveland (1993) and is a consider-
able improvement over base graphics. You can easily produce conditioned
plots and some plotting details (e.g., legends) are taken care of automat-
ically. However, lattice graphics lacks a formal model, which can make it
hard to extend. Lattice graphics are explained in depth in Sarkar (2008).
• ggplot2, started in 2005, is an attempt to take the good things about base
and lattice graphics and improve on them with a strong underlying model
which supports the production of any kind of statistical graphic, based on
the principles outlined above. The solid underlying model of ggplot2 makes
it easy to describe a wide range of graphics with a compact syntax, and
independent components make extension easy. Like lattice, ggplot2 uses
grid to draw the graphics, which means you can exercise much low-level
control over the appearance of the plot.
• Work on ggvis, the successor to ggplot2, started in 2014. It takes the
foundational ideas of ggplot2 but extends them to the web and interactive
graphics. The syntax is similar, but it’s been re-designed from scratch to
take advantage of what I’ve learned in the 10 years since creating ggplot2.
The most exciting thing about ggvis is that it’s interactive and dynamic, so
plots automatically re-draw themselves when the underlying data or plot
specification changes. However, ggvis is work in progress and currently can
create only a fraction of the plots in ggplot2 can. Stay tuned for updates!
• htmlwidgets, http://www.htmlwidgets.org provides a common framework
for accessing web visualisation tools from R. Packages built on top
1.4 About this book 7

of htmlwidgets include leaflet (https://rstudio.github.io/leaflet/,


maps), dygraph (http://rstudio.github.io/dygraphs/, time series) and
networkD3 (http://christophergandrud.github.io/networkD3/, networks).
htmlwidgets is to ggvis what the many specialised graphic packages are
to ggplot2: it provides graphics honed for specific purposes.
Many other R packages, such as vcd (Meyer, Zeileis, and Hornik 2006),
plotrix (Lemon et al. 2008) and gplots (Warnes 2007), implement specialist
graphics, but no others provide a framework for producing statistical graph-
ics. A comprehensive list of all graphical tools available in other packages can
be found in the graphics task view at http://cran.r-project.org/web/views/
Graphics.html.

1.4 About this book

The first chapter, Chapter 2, describes how to quickly get started using gg-
plot2 to make useful graphics. This chapter introduces several important
ggplot2 concepts: geoms, aesthetic mappings and facetting. Chapter 3 dives
into more details, giving you a toolbox designed to solve a wide range of
problems.
Chapter 4 describes the layered grammar of graphics which underlies gg-
plot2. The theory is illustrated in Chapter 5 which demonstrates how to add
additional layers to your plot, exercising full control over the geoms and stats
used within them.
Understanding how scales work is crucial for fine-tuning the perceptual
properties of your plot. Customising scales gives fine control over the exact
appearance of the plot and helps to support the story that you are telling.
Chapter 6 will show you what scales are available, how to adjust their pa-
rameters, and how to control the appearance of axes and legends.
Coordinate systems and facetting control the position of elements of the
plot. These are described in Chapter 7. Facetting is a very powerful graphical
tool as it allows you to rapidly compare different subsets of your data. Dif-
ferent coordinate systems are less commonly needed, but are very important
for certain types of data.
To polish your plots for publication, you will need to learn about the tools
described in Chapter 8. There you will learn about how to control the theming
system of ggplot2 and how to save plots to disk.
The book concludes with four chapters that show how to use ggplot2
as part of a data analysis pipeline. ggplot2 works best when your data is
tidy, so Chapter 9 discusses what that means and how to make your messy
data tidy. Chapter 10 teaches you how to use the dplyr package to perform
the most common data manipulation operations. Chapter 11 shows how to
integrate visualisation and modelling in two useful ways. Duplicated code is
a big inhibitor of flexibility and reduces your ability to respond to changes in
8 1 Introduction

requirements. Chapter 12 covers useful techniques for reducing duplication


in your code.

1.5 Installation

To use ggplot2, you must first install it. Make sure you have a recent version
of R (at least version 3.2.0) from http://r-project.org and then run the
following code to download and install ggplot2:
install.packages("ggplot2")

1.6 Other resources

This book teaches you the elements of ggplot2’s grammar and how they fit
together, but it does not document every function in complete detail. You will
need additional documentation as your use of ggplot2 becomes more complex
and varied.
The best resource for specific details of ggplot2 functions and their argu-
ments will always be the built-in documentation. This is accessible online,
http://docs.ggplot2.org/, and from within R using the usual help syntax.
The advantage of the online documentation is that you can see all the exam-
ple plots and navigate between topics more easily.
If you use ggplot2 regularly, it’s a good idea to sign up for the ggplot2
mailing list, http://groups.google.com/group/ggplot2. The list has relatively
low traffic and is very friendly to new users. Another useful resource is stack-
overflow, http://stackoverflow.com. There is an active ggplot2 community on
stackoverflow, and many common questions have already been asked and an-
swered. In either place, you’re much more likely to get help if you create a min-
imal reproducible example. The reprex (https://github.com/jennybc/reprex)
package by Jenny Bryan provides a convenient way to do this, and also in-
clude advice on creating a good example. The more information you provide,
the easier it is for the community to help you.
The number of functions in ggplot2 can be overwhelming, but RStudio
provides some great cheatsheets to jog your memory at http://www.rstudio.
com/resources/cheatsheets/.
Finally, the complete source code for the book is available online at https:
//github.com/hadley/ggplot2-book. This contains the complete text for the
book, as well as all the code and data needed to recreate all the plots.
1.7 Colophon 9

1.7 Colophon

This book was written in R Markdown (http://rmarkdown.rstudio.com/)


inside RStudio (http://www.rstudio.com/ide/). knitr (http://yihui.name/
knitr/) and pandoc (http://johnmacfarlane.net/pandoc/) converted the raw
Rmarkdown to html and pdf. The complete source is available from github
(https://github.com/hadley/ggplot2-book). This version of the book was
built with:

devtools::session_info(c("ggplot2", "dplyr", "broom"))


#> Session info --------------------------------------------------------
#> setting value
#> version R version 3.2.1 (2015-06-18)
#> system x86_64, darwin13.4.0
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> tz America/Chicago
#> date 2015-10-15
#> Packages ------------------------------------------------------------
#> package * version date
#> assertthat 0.1 2013-12-06
#> BH 1.58.0-1 2015-05-21
#> broom 0.3.7 2015-05-06
#> colorspace 1.2-6 2015-03-11
#> DBI 0.3.1 2014-09-24
#> dichromat 2.0-0 2013-01-24
#> digest 0.6.8 2014-12-31
#> dplyr 0.4.3.9000 2015-09-08
#> ggplot2 1.0.1.9003 2015-10-15
#> gtable 0.1.2 2012-12-05
#> labeling 0.3 2014-08-23
#> lazyeval 0.1.10 2015-01-02
#> magrittr 1.5 2014-11-22
#> MASS 7.3-40 2015-03-21
#> mnormt 1.5-2 2015-04-03
#> munsell 0.4.2 2013-07-11
#> plyr 1.8.3 2015-06-12
#> psych 1.5.4 2015-04-27
#> R6 2.1.1 2015-08-19
#> RColorBrewer 1.1-2 2014-12-07
#> Rcpp 0.12.1 2015-09-10
#> reshape2 1.4.1 2014-12-06
#> scales 0.3.0 2015-08-25
#> stringi 0.5-9003 2015-09-11
10 1 Introduction

#> stringr 1.0.0.9001 2015-10-09


#> tidyr 0.3.0 2015-08-31
#> source
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> local
#> local
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.1)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.0)
#> CRAN (R 3.2.1)
#> Github (Rexamine/stringi@02c9761)
#> local
#> local

References

Chambers, John, William Cleveland, Beat Kleiner, and Paul Tukey. 1983.
Graphical Methods for Data Analysis. Wadsworth.
Cleveland, William. 1993. Visualizing Data. Hobart Press.
Cook, Dianne, and Deborah F. Swayne. 2007. Interactive and Dynamic
Graphics for Data Analysis: With Examples Using R and GGobi. Springer.
Lemon, Jim, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowling-
son, Hadley Wickham, Anupam Tyagi, et al. 2008. Plotrix: Various Plotting
Functions.
Meyer, David, Achim Zeileis, and Kurt Hornik. 2006. “The Strucplot
Framework: Visualizing Multi-Way Contingency Tables with Vcd.” Journal
of Statistical Software 17 (3): 1–48. http://www.jstatsoft.org/v17/i03/.
1.7 Colophon 11

Murrell, Paul. 1998. “Investigations in Graphical Statistics.” PhD thesis,


The University of Auckland.
Robbins, Naomi. 2004. Creating More Effective Graphs. Wiley-
Interscience.
Sarkar, Deepayan. 2008. Lattice: Multivariate Data Visualization with R.
Springer.
Tufte, Edward R. 1990. Envisioning Information. Graphics Press.
———. 1997. Visual Explanations. Graphics Press.
———. 2001. The Visual Display of Quantitative Information. second.
Graphics Press.
Tukey, John W. 1977. Exploratory Data Analysis. Addison–Wesley.
Warnes, Gregory. 2007. Gplots: Various R Programming Tools for Plotting
Data.
Wickham, Hadley. 2009. “A Layered Grammar of Graphics.” Journal of
Computational and Graphical Statistics.
Wickham, Hadley, Michael Lawrence, Duncan Temple Lang, and Deborah
F Swayne. 2008. “An Introduction to Rggobi.” R-News 8 (2): 3–7. http:
//CRAN.R-project.org/doc/Rnews/Rnews_2008-2.pdf.
Wilkinson, Leland. 2005. The Grammar of Graphics. 2nd ed. Statistics
and Computing. Springer.
Chapter 2
Getting started with ggplot2

2.1 Introduction

The goal of this chapter is to teach you how to produce useful graphics with
ggplot2 as quickly as possible. You’ll learn the basics of ggplot() along with
some useful “recipes” to make the most important plots. ggplot() allows you
to make complex plots with just a few lines of code because it’s based on a
rich underlying theory, the grammar of graphics. Here we’ll skip the theory
and focus on the practice, and in later chapters you’ll learn how to use the
full expressive power of the grammar.
In this chapter you’ll learn:
• About the mpg dataset included with ggplot2, Section 2.2.
• The three key components of every plot: data, aesthetics and geoms, Sec-
tion 2.3.
• How to add additional variables to a plot with aesthetics, Section 2.4.
• How to display additional categorical variables in a plot using small mul-
tiples created by facetting, Section 2.5.
• A variety of different geoms that you can use to create different types of
plots, Section 2.6.
• How to modify the axes, Section 2.7.
• Things you can do with a plot object other than display it, like save it to
disk, Section 2.8.
• qplot(), a handy shortcut for when you just want to quickly bang out a
simple plot without thinking about the grammar at all, Section 2.9.

2.2 Fuel economy data

In this chapter, we’ll mostly use one data set that’s bundled with ggplot2:
mpg. It includes information about the fuel economy of popular car models

13
14 2 Getting started with ggplot2

in 1999 and 2008, collected by the US Environmental Protection Agency,


http://fueleconomy.gov. You can access the data by loading ggplot2:

library(ggplot2)
mpg
#> Source: local data frame [234 x 11]
#>
#> manufacturer model displ year cyl trans drv cty hwy
#> (chr) (chr) (dbl) (int) (int) (chr) (chr) (int) (int)
#> 1 audi a4 1.8 1999 4 auto(l5) f 18 29
#> 2 audi a4 1.8 1999 4 manual(m5) f 21 29
#> 3 audi a4 2.0 2008 4 manual(m6) f 20 31
#> 4 audi a4 2.0 2008 4 auto(av) f 21 30
#> 5 audi a4 2.8 1999 6 auto(l5) f 16 26
#> 6 audi a4 2.8 1999 6 manual(m5) f 18 26
#> .. ... ... ... ... ... ... ... ... ...
#> Variables not shown: fl (chr), class (chr)

The variables are mostly self-explanatory:


• cty and hwy record miles per gallon (mpg) for city and highway driving.
• displ is the engine displacement in litres.
• drv is the drivetrain: front wheel (f), rear wheel (r) or four wheel (4).
• model is the model of car. There are 38 models, selected because they had
a new edition every year between 1999 and 2008.
• class (not shown), is a categorical variable describing the “type” of car:
two seater, SUV, compact, etc.

This dataset suggests many interesting questions. How are engine size
and fuel economy related? Do certain manufacturers care more about fuel
economy than others? Has fuel economy improved in the last ten years? We
will try to answer some of these questions, and in the process learn how to
create some basic plots with ggplot2.

2.2.1 Exercises

1. List five functions that you could use to get more information about the
mpg dataset.
2. How can you find out what other datasets are included with ggplot2?
3. Apart from the US, most countries use fuel consumption (fuel consumed
over fixed distance) rather than fuel economy (distance travelled with fixed
amount of fuel). How could you convert cty and hwy into the European
standard of l/100km?
2.3 Key components 15

4. Which manufacturer has the most the models in this dataset? Which model
has the most variations? Does your answer change if you remove the re-
dundant specification of drive train (e.g. “pathfinder 4wd”, “a4 quattro”)
from the model name?

2.3 Key components

Every ggplot2 plot has three key components:


1. data,
2. A set of aesthetic mappings between variables in the data and visual
properties, and
3. At least one layer which describes how to render each observation. Layers
are usually created with a geom function.
Here’s a simple example:

ggplot(mpg, aes(x = displ, y = hwy)) +


geom_point()


40




● ●
● ●
● ●●
30 ● ● ●
hwy

● ● ● ● ●● ●
● ● ● ● ●
● ● ●● ● ● ● ●
● ● ● ●● ● ●● ●● ● ● ● ●
● ● ● ●● ● ● ● ●
●● ●● ● ● ● ●
● ● ● ● ● ● ●
● ● ● ● ●
● ●
20 ●
● ● ●

●●
●●

● ● ● ● ● ●●
●● ●● ● ●● ● ● ● ● ● ●
●● ● ●
● ●● ●●● ● ●
● ●

2 3 4 5 6 7
displ

This produces a scatterplot defined by:

1. Data: mpg.
2. Aesthetic mapping: engine size mapped to x position, fuel economy to y
position.
3. Layer: points.
Pay attention to the structure of this function call: data and aesthetic
mappings are supplied in ggplot(), then layers are added on with +. This is
Another Random Scribd Document
with Unrelated Content
tarry sheep—Fionn Loch—Angling deteriorated—
Good day's angling—The Dubh loch—Three trout
at a cast—Bait fishing for trout—Loch Kernsary—
Char—Char and trout, and pink and white-fleshed
trout, indistinguishable to the taste—Burn fishing
—Best time for trout fishing—Eels—Pike—Their
introduction described by Dr Mackenzie—Re-
introduced in Sir Kenneth's time

Chapter XIX.—Salmon Angling.


Salmon rivers—The Ewe—Cruives—The old
cruive used for crossing the river—Roderick
Campbell and an American merchant drowned—
The new cruive—Gradual diminution of stock of
salmon—Length of the Ewe—Pools on the east
side—Pools on the other side—Runs of salmon
and grilse—Kelts—Bull-trout—Sea-trout—Large
salmon—Best flies—Dr Mackenzie's anecdote of
Sir Humphrey Davy—John Bright—Odd incidents
—Damaged fly—Successful fishing after a friend—
Hooking a fish after losing another—Was it a rise?
—Fish taking when line slack—Kelt caught twice—
Holding on for five hours—Angler compared to
the evil one—Water-bailiffs—John Glas—Sandy
Urquhart—His loquacity—Fishing on the Ewe—
Tailing salmon—Spiked gloves—Bags of salmon
now and formerly—Singular mode of fishing by Sir
Hector—Charms of the Ewe—Other salmon rivers
in Gairloch 366

Chapter XX.—Deer Forests and Grouse Shooting.


The red deer—Free to roam—Antiquity of— 372
Formerly scarce—Meaning of "forested"—List of
deer forests—Estimated yield and stock—Stag
season—A "royal"—Best heads—Hinds—Deer-
stalking—Great caution required—Staghounds not
much used now—Quotation from John Taylor, the
"Water-Poet"—Present system of letting deer
forests—Colonel Inge in Gairloch—Misconceptions
with regard to deer forests—Opinions of the
Crofters Commission—Depopulation not due to
deer forests—Deer forests not suitable for
occupation by crofters—Loss of mutton and wool
insignificant—Depredations by deer on crofters'
crops easily remedied—Deterioration of pasture
by deer not proved—Demoralization of gillies not
due to forests—Summary of opinions—Substantial
benefits conferred by deer forests—Afford
employment to a greater extent than sheep farms
—Recommendation by Commissioners—Grouse
shooting—Grouse not abundant—Disease
infrequent—Late birds—Mixed bags—Separate
grouse shootings

List of Books and MSS. Quoted or Referred to 381

Statement of Authorities for Traditions, &c., embodied


in this Book 383

Tables.

I.Mountains of Gairloch 387


II.Distances 387
III.Population of Gairloch 390
IV.Ministers of the parish of Gairloch 390
V.Lairds of Gairloch 391
Appendices.

A.Genealogical Account of the MacRas, by Rev.


John Macrae, who died 1704 395
B.Tour in Scotland by Thomas Pennant in 1772 396
C.Old Statistical Account of Scotland, 1792 399
D.Dr MacCulloch's Highlands and Western Isles of
Scotland, 1811 to 1821 400
E.New Statistical Account of Scotland, 1836 403
F.Records of the Presbytery of Dingwall 408
G.Records and Extracts relating to Sir George Hay
and the Manufacture of Iron 412
H.Addenda on St Maelrubha, and Ecclesiastical
History 415

Index 419
Errata 436
Addenda 436

The pronunciation is given approximately in parentheses. In many


cases no combination of letters pronounced in English fashion can
accurately represent the Gaelic pronunciation.
The pronunciation of ch is almost the same in Gaelic as in German.
Sometimes the ch is best rendered as an aspirate only, the c being
treated as if silent.
The letter c, unless followed by h, is always pronounced in Gaelic
like the English k, a letter not found in Gaelic.
The Gaelic pronunciation of the letters b, d, and g is soft, and they
are often sounded more as if they were p, t, and k.
In Ross-shire Gaelic sr is pronounced as if it were str, and rt as if it
were rst.
The consonant d before the vowels e and i, whether followed by
another vowel or not, is pronounced as if it were j.
The consonant s before the vowels i or e is sounded as sh.
The consonant l has a liquid double sound, unlike anything in
English; it may be approximated by lisping the vowel u before and
the letter y after the ordinary sound of the letter l.
The letter h after the consonants d, f, g, t, and s, in Ross-shire
Gaelic, renders those consonants silent; bh and mh are usually
pronounced like v, a letter not found in the Gaelic alphabet.
Sometimes adh seems to be pronounced very like ag.
The possessive case is frequently formed in Gaelic by the insertion of
the letter h after the initial consonant, and of the letter i after the
vowel in the first or second syllable.
The aspirate h is often inserted between the definite article and a
noun beginning with a vowel. Sometimes the letter t is similarly
inserted before a noun commencing with a consonant. These, and
some other changes, are made for the sake of euphony.
The vowel sounds can only be defined with difficulty. The attempts
made in this glossary are but imperfect. It may be stated that ach is
generally pronounced och; ao and u, as oo; ea, as a in "bake"; a, e,
and i, usually as in French; ei, sometimes as a in "bake," and
sometimes as i in "bin"; and ai is sometimes almost like u in "dull,"
and sometimes like a in "tan."
Anyone desiring to pronounce a Gaelic name or word correctly,
should ask a native to render it, and try to imitate him; even then, in
some cases, it will be impossible to be exactly right.

A cheardach ruadh (ar charstock rooer), The red smithy.


Ceardach, a smithy; ruadh, red.
A Mhaighdean (ar veytchen), The maiden. See Maighdean.
Achagarbh, properly spelt Achadhgarbh (ach a garrav), Rough
field. Ach, a field; garbh, rough.
Achagarve. See Achagarbh.
Achdistall, or Achdiestal (achjestel), Field of Diestal. Ach, a field;
Diestal, a Norse word, probably the name of a rock.
Achnasheen (achnasheen), Field of storms. Ach, or achadh, a
field; sian (shee-on), means wind and rain combined, i.e., a
rainstorm. Sian dubh (black storm) is so-called in
contradistinction to a snowstorm, which is designated cur is
cathadh. An old Kintail priest long ago prophesied that this
country would be brought to nought by Sian dubh, and that the
people would have to go away to islands at the other side of the
world.
Achtercairn, properly Achadhacharn (achterkairn), Field of the
cairn. Ach, or achadh, a field; carn, a heap of stones.
Aigeascaig (aigaskaik). Name of place, meaning unknown.
Colonel Robertson says Aigeas is a corruption of aiguisg, by
reason of the water. The termination aig signifies a small bay; it
was originally Danish.
Aird (aird), a height, a promontory or headland.
Aird na h'eigheamh (art na heyhugh), eight of calling. Aird, a
height; eigh, to call.
Airdheslaig (artishlak). Supposed to be a Norse name. Aird, a
height; heslaig may be for h'aslaich, aslaich, to entreat;
aslachadh, entreaty.
Alastair Breac (allaster brake), Alexander the spotted. Alastair,
Alexander; breac, spotted, or more correctly pock-marked. See
Breac.
Alastair Buidhe Mackay, properly MacAoidh (allaster boo-ie
mackai), Yellow Alexander Mackay. MacAoidh is pronounced
Macooie.
Alastair Buidhe MacIamhair (allaster boo-ie makeemver),
Yellow-haired Alexander MacIver; pronounced MakEever.
Alastair Liath (allaster leear), Grey-headed Alexander. Liath,
grey, grey-headed. It means light blue when not applied to a
human being.
Alastair MacIain Mhic Earchair (allaster makeeanvic erraquhar),
Alexander, son of John, son of Farquhar. Earchair is incorrectly
written for Fhearchair, the possessive of Farquhar; Fhearchair is
pronounced Erraquhar or Earchair.
Alastair Mor an t' Sealgair (allaster more ant shollager), Big
Alexander the hunter. Sealgair, a hunter, a stalker, literally a
sneaker.
Ali' Iain Ghlais (alian loss), Alexander [son] of Pale John. From
Alie (short for Alastair), Alexander; Iain, John; and glas, pale or
sallow. Glas means grey when not applied to human beings.
Alie Uistean (ally ooshtan), Alick Hugh. Alie, short for Alexander.
See Uistean.
Allt a Choire Dhuibh Mhoir (arlta corrie oo-ie vore), The burn of
the great black corrie. Allt, a burn; choire, possessive of coire, a
corry; dhuibh, possessive of dubh, black; mhoir, possessive of
mor, great.
Altgreshan, properly Alltgrisean (alt-grishan), Roan or grizzly
burn. Allt, a burn; grisfhionn (grishan), grizzly.
Am port Leathach (am porsht layoch), The port at half [tide].
Leath is half.
An Amilt, or An Amhuilt (ann amvilt). Name of a place; means
the stratagem.
An Fhridh dhorch (an ree dorroch), the dark forest. Fridh,
forest; dorch, dark.
An Groban. See Groban.
An t' Eirthire Donn. See Eirthire Donn.
Angus. See Aonghas.
Aonghas (unnus), Angus, or Æneas, which last is nearer in
sound to the Gaelic.
Applecross. English name as now used. Colonel Robertson says
it is for the Gaelic Abercroisean, or Abhircroisean, from aber,
mouth, or confluence of; croisean, of troubles; or perhaps
croisean was the name of the little river.
Ardlair (ardlair), The mare's height or headland. Aird, a height;
lair, a mare.
Ath nan ceann (arnankown), Ford of the heads. Ath, a ford;
ceann, heads. Often written Anagown.
Aultbea, should be spelt Alltbeithe (arltbay), Burn of birches.
Allt, a burn; beath, or beith, a birch.
Bac an Leth-choin (bark an lechun), Shelf of the crossbred dog.
Leth-choin, a crossbred dog, a lurcher. Bac is a shelf or flat on
the side or top of a hill; in this case the name is popularly
applied to the whole hill.
Bac Dubh (bark dhoo), Black shelf. Bac, a shelf or flat place
among rocks or on a hill; dubh, black.
Bad (bat), a clump, a grove.
Bad a Chrotha (badachro). Full Gaelic spelling of Badachro,
which see.
Bad a mhanaich (bat er vannich), Grove of the monk. See Bad.
Mhanaich, possessive of manach, a monk.
Bad an t' Sluig (bat ant slook), Grove of the miry puddle. Bad, a
grove; sluig, possessive of slug, a miry puddle.
Badachro (badachro), Grove of the cruive. Bad, a grove; chro,
possessive of cro, a cruive, a fank.
Badfearn, should be Badfearna (batfern), Alder grove. Fearn,
the alder tree. See Bad. The place has still a clump of alders.
Badluachrach (bat loocharar), Rushy clump. Luachair, rushes.
Baile na h'eaglais (bally-na-herkless), Town of the church, or
Kirkton. Baile, a town; eaglais, a church. Compare Ecclesia.
Ballymeon (bally-mey-on), properly spelt Baile-meadhon,
pronounced exactly the same. Baile, a town; meadhon, middle.
Anglicè, Middleton.
Bard Mor an t' Slaggan (bart more ant slaggan), The great or
big bard of Slaggan, which see.
Bard Sasunnach (bart Sassenach), English bard. Sasunnach,
English, i.e. not a Gaelic speaker.
Bathais Bheinn (boorsh ven), Forehead mountain (very
descriptive). From Beinn, mountain, and bathais, forehead; or
perhaps it should be called Baoisg Bheinn (boiskivin), the
mountain of gleaming, because it catches the first rays of the
rising sun. This is also true of this mountain.
Beag (bek), little. It seems to appear as bach in some English
names.
Beallach Glasleathaid (baaloch glass laid), Pass of the gray
slope. Beallach, a pass; glas, pale; leathaid, possessive of
leathad, a slope.
Beallach nan Brog (baaloch nam progue), Pass of the shoes.
Brog, a shoe.
Beallach a Chomhla (baaloch a korvla), Pass of the door.
Comhladh, a door.
Beinn Alligin (bin allikin), Jewel mountain. Properly Ailleagan, a
jewel, or darling, anything precious.
Beinn a Chaisgean (bin a harshkin), Mountain of casgean; which
may be a corruption of caisg, Easter.
Beinn Aridh Charr (bin arry har), The mountain of the rough
shieling. Beinn, a mountain; aridh, a shieling; charr, a
corruption of garbh, rough.
Beinn a Chearcaill (bin a herkill). Mountain of the hoop. Cearcall,
a hoop. Descriptive of bands or lines of stratification encircling
this hill.
Beinn a Mhuinidh (bin ar voonie), Mountain of the "Pisvache."
Beinn an Eoin (bin-in-eeōn), The mountain of the bird. Beinn, a
mountain; eoin, possessive of eun, a bird. The bird in this case
is the ptarmigan.
Beinn Bheag (bin vek), Little mountain. Beag, little.
Beinn Bhreac (bin y vraick), Spotted mountain. Breac, spotted.
Beinn Damph, properly Beinn Damh (bin damff), Mountain of
the stag. Damh, a stag.
Beinn Dearg (bin jarrak), Red mountain. Beinn; and Dearg, red.
Beinn Eighe (bin ay), File mountain. Eighe, a file. The topmost
ridge is jagged or serrated like a file.
Beinn Lair (bin lar), Mountain of the mare. Lair, a mare.
Beinn Liathgach (bin learoch). This mountain should not be
called Beinn Liathgach, but Liathgach, which see.
Beinn na h' Eaglais (binnaherkless), Mountain of the church.
Beinn, mountain; eaglais, church.
Beinn nan Ramh (bin an rahv), Mountain of the oar. Ramh, an
oar.
Beinn Slioch or Sleugach (bin sleoch). Should be Slioch without
Beinn. See Slioch.
Beinn Tarsuinn (bin tarsing), Mountain across.
Beinn Tarsuinn Chaol (bin tarsing chool), Narrow Beinn
Tarsuinn. Caol, narrow or slender.
Bhantighearna Ruadh (vancherna rooar), Red lady.
Bhantighearna, literally she-lord.
Bho Iutharn, or Bho Iuthrna (vo ewern), From hell. Bho, from;
Iuthrna, hell.
Bidean clann Raonaild (peetyan clan ruynuld), Clan Ranald's
peak. Bidean, a peak.
Blar na Fala (blar ner falla), Plain of the blood. Blar, a plain or
bog, or flat place; fala, possessive of fuil, blood.
Blar na Pairc (blar ner park), Battle of the park. Pairc,
possessive of parc, a park or field.
Bonaid donn (boanat down), Brown bonnet. Bonaid, a bonnet, a
cap; donn, brown.
Boor (bore). Either from buradh, a bursting forth of blood; or
from a word containing the root boor, meaning "roaring,"
because stags used to roar here.
Bothie (bothy, othie pronounced as in frothy), a little hut or
hovel. Both, a hut. Compare English booth. The ie is an old
Gaelic diminutive, often written idh.
Braemore, properly Braighmor (bray more), Great summit or
hill. Mor, great; braigh, summit.
Breac (brake), spotted, marked with smallpox (when applied to
human beings), a trout.
Breacan an Fheilidh (brayken an aylie), the belted or kilted
plaid. Breacan, a tartan plaid; fheilidh, possessive of feileadh, a
kilt.
Bruachaig (brooachak). Perhaps from Bruach, and achadh, a
field; bruach, a bank, border, edge, steep; aig, means a small
bay in old Danish.
Buaile na luib (pool na loop), Fold of the bend. From buaile, a
fold; and luib, a bend or loop.
Buidhe (boo-ie), yellow-haired, yellow.
Cabar Feidh (kapper fay), deer's antler. Cabar, antler, or a stick;
feiah, possessive of fiagh, deer.
Cabar Lar (kapper law), Turf parer. Cabar, a stick; lar, a floor,
the ground.
Cadha Beag (kaar pek), Little pass in the rock. Beag, little;
cadha, a pass in a rock.
Cailleach a Mhuillear (kaillyoch a vuillyear), The miller's wife.
Cailleach, an old woman; muillear, miller.
Cailleach Liath Rasaidh (kaillyoch leear raasa), Grey old woman
of Raasay. Cailleach, an old woman; liath, grey (light blue when
not applied to a human being).
Callum a Ghlinne (kallum a glinnie), Malcolm of the glen.
Callum, Malcolm.
Carn a Ghlinne (karn a glinnie), Cairn of the glen. Carn, a cairn
or heap of stones; ghlinne, possessive of gleann, a glen.
Carn Anthony (karn anthony), Cairn of Anthony. Carn, a heap of
stones.
Carn Dearg (karn jarrak). Red cairn. Carn, a heap of stones. See
Dearg.
Carn Liath (karn leear), Light blue cairn. Carn, a heap of stones;
liath, light blue.
Cas chrom (kas-rhoum), foot plough; literally crooked foot, from
cas, a foot; and crom, crooked.
Cathair mhor (kaar more). Big seat, i.e. Fairies' seat. See
Kerrysdale.
Ceann a Chro (kayoun-a-chroe), End or head of the cruive.
Ceann, end or head; cro, a cruive, or fank.
Ceann a chruinn (kayoun a chreinie), mast head, or tree head or
end. Ceann, a head, end; cruinn, possessive of crann, a tree or
mast.
Ceann an t' sail (kayoun an tarl), end or head of the salt water.
Ceann, end or head; sail, salt water. Corrupted further south
into Kintail.
Ceann loch iu (kayoun loch ew), head of Loch Ewe. Ceann, a
head.
Ceardach ruadh (karstoch roo-er), Red smiddy. See A cheardach
ruadh.
Ceilidh (kayley), social meetings. From ceilidh, to visit.
Ceistear crubach (kaister crupboch), lame catechist. Ceistear, a
catechist; crubach, lame.
Cibear Mor (keeipber more), big shepherd. Cibear, a shepherd;
mor, great or big.
Clach (klarch), a stone. Possessive, Cloiche. Compare clough,
found in some English names.
Clach a Mhail (klarch ar varl), Stone of rent. Clach, a stone; Mal,
rent, tribute.
Clach an t' Shagart (klarch an taggart), Stone of the priest.
Clach, a stone; shagart, possessive of sagart, a priest.
Clach nam Brog (klarch nam progue), Shoe stone. Clach, a
stone; brog, a shoe.
Clachan garbh (klachan garrav), Rough village. Clachan, a
village; literally stones; supposed to have originally been a
Druidical term. See Garbh.
Cladh nan Sasunnach (klug nan sarsenach), Burial-place of the
English. Cladh, a burial-place; Sasunnach, English, Saxon, not a
Gaelic speaker.
Claidheamh mor (klymore), a broadsword, a claymore.
Claidheamh, a sword; mor, great, here broad.
Clais na leac (klarsh na lyck), Hollow of the flat stones or flags.
Clais, a furrow, a hollow between ridges or hills; leac, a flag.
Claonadh (kluanar), slopes. Compare inclining.
Clann Eachainn (klan erchen), offspring of Hector. Clann,
offspring or descendants. See Eachainn.
Claymore. See Claidheamh mor.
Cleireach (klearoch), literally clerk. Priests often called so from
their scholarship. The Priest island off the Greenstone Point is
called Cleireach in Gaelic. Compare Clericus.
Cliabh moine (kleea moanyer), peat creel. Cliabh, creel; moine,
peats.
Cliff, or Clive (Gaelic Clu). See Meall na Cluibha.
Clu (kloo), a local name; now treated as synonymous with
English cliff. See Meall na Cluibha.
Cnoc a chrochadair (kroka chrochater), Hangman's hill. Cnoc, a
hill, a hillock; chrochadair, possessive of crochadair, a hangman.
Cnoc a croiche (krok a chroich), Gallows hill. Croich, a gallows.
Cnoc na mi-chomhairle (krok na mee ho-airlie), Hillock of evil
counsel. Cnoc, a hillock; mi (like mis-), evil, comhairle, counsel.
Mi is also a negative prefix like un-.
Coigeach (ko-yoch), probably the "fifth portion" [of a davach].
Coig, five.
Coille Aigeascaig (kul yaikaskaik); Wood of Aigeascaig. Coille, a
wood; see Aigeascaig.
Coinneach (kuinyoch), Kenneth. The progenitor of the
Mackenzies.
Coinneach Mac Sheumais (kuinyoch mak eearmis), Kenneth the
son of James. Coinneach, Kenneth; Seumas, James.
Coinneachadh Beag (koonyochor bek), Little meeting-place.
Coinneachadh, meeting-place; beag, little.
Coire an Easain (corrie an easan), Corrie of the little waterfall.
Easan, a little waterfall.
Coire Cheud Cnoc (corrie hehud crok), Corrie of a hundred
hillocks. Coire, a corrie; ceud, hundred; cnoc, a hillock.
Coire Cheud Creagh (corrie hehud krayar), Corrie of a hundred
spoils. Coire, corrie; ceud, a hundred; creagh, spoils. Name
erroneously given by some to the Corrie of a hundred hillocks.
See last name.
Coire Dubh Mor (corrie dhoo more), Great black corrie (or dell).
Coire Mhic Cromail (corrie vic krommle), The corrie of the son of
Cromail. Mhic, of the son of; Cromail, an old name, meaning
unknown.
Coire nan Cuilean (corrie nan coollin), Corrie of the cubs.
Cuilean, a cub, a pup.
Coppachy, properly Copachaidh (koppachie), Foam field. Cop,
foam; achadh, a field.
Corcur (korker), red, crimson.
Cota gearr (koita gaerr), short coat. Cota, a coat; gearr, short.
Co-thional (ko-yearnal), gathering together. Comh, or co,
fellowship (compare company); tional, gathering.
Cove. English name altered from cave. The Gaelic name of the
place is really An Uamhaidh (nouahvie), or the place of caves,
from uamh, a cave. But it is more properly called An Uamh
Mhor, or the great cave, a name descriptive of the cave still
used as a place of worship.
Cradh Gheadh (crargeear), Shieldrake. Geag, a goose.
Craig (kraik), a crag or rock; properly spelt creig, or creag.
Craig a Chait (kraig a hart), Rock of the cat. Chait, possessive of
cat, which is the same in Gaelic as in English, but was originally
applied only to the wild cat.
Craig an Dubh Loch (kraigan dhoo-loch), Rock of the black loch.
Craig an Fhithich (kraig an eech), Crag of the raven. Fhithich,
possessive of fitheach, a raven.
Craig an Fhithich Mhor (kraig an eech vore), Big crag of the
raven.
Craig an t' Shabhail (kraig an towl), Rock of the barn. Sabhal, a
barn.
Craig Bhadain an Aisc (kraik vatn an ashk), Rock of the clumps
or groves of burial. Badan, clumps or groves; aisc, obsolete
word, meaning burial or interment, or preparation for burial.
Craig Bhan (kraig varn), White crag. Ban, white; and see Craig.
Craig Roy. Properly Craig Ruadh, which see.
Craig Ruadh (kraik roo-er), Red crag. See Craig and Ruadh.
Craig Thairbh (kraik-harve), Bull rock. Tarbh, a bull.
Craig Tollie (kraig tollie), properly Creag Thollie (kraig holly),
Rock of Tollie. See Tollie.
Crannag (crannog). A crannog, or insulated fortress, usually
constructed on piles in a loch; the same word as crannag, a
pulpit.
Crasg (krask). Meaning uncertain, possibly something that lies
across. Crasg is the top of a spade, or cross piece of a crutch.
Crasgach is something that goes contrary.
Creagan an Inver (kraigan an innyr), Little rock of the mouth of
the river. Inver, mouth of a river.
Cromasaig, properly spelt Crom Fhasadh (krommasak), Crooked
hollow. Crom, crooked; fhasadh, possessive of fasadh, a hollow.
Crubach (kruboch), lame of a leg. Compare cripple.
Cruitear, or Cruitire (kroo-iter), a musician, a harper.
Cuairtear nan Gleann (kooairter nan gleyoun), Pilgrim of the
glens. Cuairtear, a pilgrim; gleann, glens.
Cu-dubh (koo dhoo), black dog. Cu, a dog.
Cuil an Scardain (kool an scarten), Corner of the screes. Cuil, a
corner, a nook; sgardan, screes. The name is very descriptive.
Cuilchonich (kulhoanie), Mossy corner. Coinneach, green moss;
cuil, a corner.
Culinellan, properly Cul an eilean (koolineylen), Back of the
island. Cul, back of; eilean, an island.
Cumha Thighearna Ghearrloch (koovtcheerna yairloch), Lament
of or for the laird of Gairloch. Cumha, lament. See Tighearna.
Dal Cruaidh (dal crewie), hard field or flat. Dal, a flat field;
cruaidh, hard.
Darach (darroch), an oak.
Dearg (jarrak), red, like a rose.
Diabaig (teapik). Norse name, meaning unknown; possibly
connected with Dia, God; aig, a small bay, so that it may mean
the small bay of God. Perhaps this has reference to religious
rites imported from the neighbouring monastery of Applecross.
Diabaig is spelt Typack on the map of 1662.
Doire (derry), a grove.
Domhnull Dubh (donnullul dhoo), Black Donald. Domhnull,
Donald; dubh, black.
Domhnull Gorm (donnullul gorrum), Blue Donald. Gorm, blue.
Domhnull Greannach (donnullul gruonnoch), Sour or savage-
looking Donald. Greannach also means irascible.
Domhnull M'Eaine Roy Vic Choinnich, should be Domhnull Mac
Iain Ruadh Mhic Choinnich (donald mak eean ruar vick
kuinyoch), Donald son of John Roy (red John) son of Kenneth.
Mac, son of; Mhic (or Vic), possessive of Mac.
Domhnull Mor (donnullul more), Big Donald. Domhnull, Donald;
mor, big.
Domhnull Odhar MacIain Leith (donnullul our mak yan lay),
Sallow or dun Donald son of Iain Liath or grey-haired John.
Odhar also means drab. Leith, possessive of Liath, grey.
Donald. See Domhnull Dubh, &c. Donald is often written in
these pages instead of its Gaelic spelling.
Donn (down), brown, bay, or sable. Compare dun.
Donnachadh Mor na Tuaighe (donnochar mor na tew-ay), Big
Duncan of the axe. Donnachadh, Duncan; mor, big; tuagh, an
axe.
Donnachadh na Fadach (dunochar na fardoch), Duncan Fadach.
Donnachadh, Duncan; Fadach, name of the farm he had in
Kintail before he came to Inveran.
Druim a Chait (dream a-hart), Ridge of the cat. Druim, a ridge;
chait, possessive of cat.
Druim Carn Neill (dream karneyal), Ridge of the cairn of Neil.
Druim, or droim, a ridge or keel.
Drumchork, properly Druim a choirc (drum-a-hawk), Ridge of
corn, or oats. Druim, a ridge; coirce, oats, corn.
Dubh (dhoo), black.
Dubh Loch (dhoo-loch), Black loch.
Dun (doon), a castle; Dunan (doonan), a small castle.
Dun Naast (doonarst), Castle of Naast. See Naast.
Eachainn (erchen), Hector. Hector is considered the English
equivalent, though it is not a translation of this Gaelic name.
Eachainn Geal (erchen gayal), White Hector. See Eachainn and
Geal.
Eachainn Ruadh (erchen roo-er), Hector Roy. Hector is
considered the English equivalent for Eachainn; and see Ruadh.
Eilean (eylan), an island, isle.
Eileanach (eylanoch), Island of the field. Eilean, isle; ach, or
achadh, or achaidh, a field. Perhaps it would be more accurately
translated The place of islands.
Eileandonain (eylan donnan), Island Donain. Donain, name of a
saint, probably short for Donnachadh, or Duncan.
Eilean a Mhor Righ (eylan a vor ree), Island of the great king.
An erroneous suggestion of the origin of the name Maree.
Eilean Dubh na Sroine (eylan dhoo na stronyer), Black island of
the nose or promontory. Dubh, black; sron (stron), a nose or
promontory.
Eilean Grudidh (eylan gruydgie), Island Grudie. See Eilean and
Grudidh.
Eilean Horisdale (eylan horrisdel), properly Eilean Thorisdal, the
island of Thorsdale, a Norse name, which see.
Eilean Maree (eylan maree), Isle Maree. See St Maelrubha.
Eilean na h' Iolaire (eylan nar hewlar-yer), Island of the eagle.
Iolaire, an eagle.
Eilean Ruaridh Beag (eylan rooarie vek), Little island of Rorie or
Roderick. Beag, little.
Eilean Ruaridh Mor (eylan ruorie mor), Big island of Rorie. Mor,
big.
Eilean Suainne (eylan soo-in), Everlasting isle. Suainne,
everlasting.
Eirthire Donn (erriyer down), Brown shore. Eirthira, shore;
donn, brown.
Erradale (erradale). Norse; probably from earr, a boundary, the
edge of.
Ewan McGabhar, properly Eoghan Mac Gabhar (ewen mak
gower), Ewan son of the goat. Gabhar, a she-goat.
Ewe (ew). May be a corruption from uisge (usque), water.
Compare similar Welsh root gwy, water, as in Wye.
Faidhir Mor (fire more), Great market. Faidhir, a fair or market;
mor, great or big.
Failte Uilleam Dhuibh (falt yllyam oo-ey), Black William's salute.
Failte, a salute; Uilleam, William; dhuibh, possessive of dubh,
black.
Fannich, properly Fanaich (fannich). Meaning unknown.
Faoileag (fewlak), a sea-gull, name for a dog.
Farquhar (properly Fearchar) Buidhe (farkar boo-ie), Yellow-
haired Farquhar. See Buidhe.
Fasagh (fassoch). From Fasadh (pronounced fassoch), meaning
a hollow.
Fe Leoid, properly Feith Leoid (fay lee-oade), The bog of Leod
(Loud). Feith, a bog; Leoid, possessive of Leod, a Norse
Christian name.
Feachaisgean, properly Feith Chaisgean (fay harshkin), Bog of
Casgean. See Beinn a Chaisgean.
Feadag-chuirn (fettak hee-oorn), Cairn plover. Gaelic name of
the dotteril. Feadag, a plover; chuirn, possessive of carn, a
cairn.
Fear, Feur, Feir, or Fiar loch (fear loch), sedgy loch. Feur,
possessive feoir (feyoar), sedge, reedy grass.
Fear Shieldaig (fear shieldak), The goodman of Shieldaig. Fear
means a man, a goodman.
Fedan Mor (fettan more), Big gullie. Fead (fet), a whistle;
feadan, a little whistle or whistling thing (applied to a gully
because the wind whistles through it). Feadag, the feminine
diminutive of fead, is the name given to the golden plover on
account of its piping.
Feileadh-beag (faylabek), philabeg, or kilt; literally little kilt, i.e.
the kilt made up separately as distinguished from the Breacan
an Fheilidh, the belted or kilted plaid.
Feill Iudha (fail you-her), Ewe market. Feill, a market; Iudha,
possessive of Iu, Ewe.
Feir loch. See Fear loch.
Feith an Leothaid. Same as Fe-Leoid, which see. This is the
more correct spelling.
Feith Mhic Iain Dhuibh (fay vik an ooie), The bog of Black John's
son. Feith, a bog. See Mac Iain Dhuibh.
Feithean Mor, properly Na feithean mor (fain more), The great
morasses. Feith (pl. feithean), a morass, a bog.
Feur loch. See Fear loch.
Fiaclachan (feearclochon), little toothed things. Diminutive of
fiaclach, toothed or jagged, i.e. the little jagged rock; very
descriptive.
Fiar loch. See Fear loch.
Fionn Loch (fee-un-loch), Fingal's loch, or The white loch. It is
called Loch Finn on the map of 1662. Fionn means white, pale,
or wan. It is said the Fingalians were called the white men in
contradistinction to the Dugals or black men.
Fionnla Dubh MacGillechriosd (feeounla dhoo mak gillie chree-
est), Black Finlay, son of the servant of Christ. See
MacGillechriosd.
Fionnla Dubh na Saighead (feeounla dhoo na side), Black Finlay
of the arrow. Saighead, an arrow.
Fionnla Liath (feeounla leear), Grey Finlay. Liath, grey.
Firemore. See Faidhir mor.
Foura (foora), an island at the mouth of Loch Ewe. The name
includes the Norwegian suffix "a," meaning an island. Fuar
(four) is Gaelic for cold.
Fraoch-eilean (frooch-eylan), Heather isle. Fraoch, heather.
Fuirneis (furniss), Furnace. This name was most likely originated
here by iron-workers from Furness in Lancashire. Furness,
according to Rev. Isaac Taylor, may be Fireness, the "fire isle,"
or "Fore-ness." Ness is Norse for a nose or headland.
Gael (gale), properly Gaidheal (gai-al), a Highlander, a Gael.
Gaelic (gallik), properly Gaidhealach (gai-alloch), Highland.
Gairloch (garloch), Short loch. Originally, and more correctly,
spelt Gearrloch or Gerloch. Gearr, short. It is always spelt
Gearrloch in Gaelic.
Garadh Iaruinn (gaarogh eerun), Iron dyke. Garradh, a dyke, a
fence wall; iaruinn, iron.
Garavaig, properly Garbhaig (garavaik), name of a small river or
burn. The termination "aig" is said to be old Danish, and means
a small bay, but the prefix is probably from garbh, rough.
Garbh (garav, or garve), rough.
Garbh Choire (garav chorrie), Rough corrie.
Garbh eilean (garaveylan), Rough island. Garbh, rough.
Geal (gayal), white, bright.
Gille (gillie), a lad, a young man, a gillie, a servant.
Gille Buidhe (gillie boo-ie), Yellow, or yellow-haired gillie. See
Gille.
Gille Cailean Mor (gilly callain more), The lad big Colin. See
separate words.
Gille Dubh (gillie dhoo), Black, or black-haired lad.
Gille Riabhach (gillie ree-oach), Brindled lad. Riabhach, brindled.
Gillean (gillyon), lads. Plural of Gille, which see.
Gillean an t' Sealgair (gillyon ant shallager), the hunter's lads.
Gillean, lads, or young men; sealgair, a hunter.
Gillespic (gill-yespik), servant of the bishop. Gille, servant;
easbuig (espik), bishop. Compare Episcopus.
Glac Mhic Iain Dhuibh (glark vik an oo-ie), Hollow or dell of the
son of Black John. Glac, a hollow or dell; Mhic, possessive of
Mac, the son of; dhuibh, possessive of dubh, black.
Glac na Sguithar (glark nar skither), Hollow of Sguithar. An old
name; meaning now lost.
Glas (glosh), grey. When applied to a man it means that he is
pale or sallow, never grey-haired.
Glas eilean (glosh-eylan), Grey island. Glas, grey; eilean, an
island.
Glas Leitire (glosh laytcher), Grey slope. See Glas and Leitir.
Glen, properly Gleann (glen or gloun), a valley, a dale.
Glen a Bianasdail (gloun ar beeanarstle), Glen of skin field or
dale, or thal. Bian, a wild animal's skin.
Glen Cruaidh Choillie (glen or gloun cruchollie). May perhaps be
the hardwood glen. Cruid, hard; coille, wood.
Glen Dochartie, properly Gleann Dochartidh (gloun dochartie).
Dochart, or Dochartie, is believed to have been the name of a
man.
Glen na Muic (gloun na mook). Muic, possessive of muc, a pig.
Gobha dubh an uisge (gow dhoo an uisk), Blacksmith of the
water. Gobha, a smith; dubh, black; uisge, water.
Gorm (gorrum), blue.
Groban (groben). Probably a grooved rock, from grobadh, to
groove.
Grudidh, more correctly Gruididh (gruydyie). Possibly from
gruid, dregs; because the dregs and sediment of several burns
drain into the Grudidh river.
Gruinard, in Gaelic Gruinaird (grinyard). Meaning unknown; may
be from grian, the sun, and aird, a height. It used to be
sometimes spelt Greinord; may be Norse.
Hector Roy. English rendering of Eachainn Ruadh, which see. No
Gaelic word begins with H.
Heglis Gherloch, for Eaglais Ghearrloch (erkless yairloch),
Church of Gairloch. Eaglais, a church.
Heglis Loch Ew, for Eaglais Loch Iu (erkless loch ew), Church of
Loch Ewe.
Horisdale. See Eilean Horisdale.
Iain Buidhe (eean boo-ie), Yellow, or yellow-haired John. Iain,
John. See Buidhe.
Iain Buidhe Taillear (eean boo-ie tyler), Yellow-haired John the
tailor. Taillear, a tailor.
Iain Caol (eean cool), Slender John. Caol, slender.
Iain Dall (eean toul), Blind John. Dall, blind.
Iain Dubh Mac Ruaridh (eean dhoo mak rooarie), Black John,
son of Rorie or Roderick. See separate words.
Iain Geal Donn (eean gel town), Whitey-brown John. Geal,
white; Donn, brown.
Iain Gearr (eean garr), Short John. Gearr, short.
Iain Gearr Mac Mhurchaidh Mhic Iain (eean garr mak muroochie
vic yan), Short John, son of Murdo, son of John.
Iain Glassich (eean glassoch), John of [Strath] Glass.
Iain Liath (eean leear), Grey John. Liath, grey.
Iain MacAllan Mhic Ruaridh (eean mak allan vik rooarie), John,
son of Allan, son of Rorie. See separate words.
Iain Mac Coinnich Mhic Eachainn (eean mak kunyich vik
erchen), John, son of Kenneth, son of Hector.
Iain Mac Eachainn Chaoil (eean mak erchen chooil), John, son
of slender Hector. Chaoil, possessive of caol, slender.
Iain Mac Ghille Challum (eean mak illie challum), John, son of
the lad Malcolm. See Mac Ghille Challum.
Iain Mac Iain Uidhir (eean mak an eer), John, the son of dun
John. Uidhir is the possessive of odhar, dun.
Iain Mor am Post (eean more am post, pronounced like cost),
Big John the post.
Iain Odhar Mac Iain Leith (eean our mak an lay), Dun John, son
of Grey John. Odhar, dun; liath, grey.
Iain Ruadh (eean ruor, or ruag), John Roy, or Red John.
Innis a Bhaird (ish y vard), Oasis (or "clearing") of the bard.
Innis, an island, or green oasis in a brown heathery region;
bhaird, possessive of bard.
Innis Ghlas (inch gloss), The grey oasis. See Innis a Bhaird.
Glas, grey.
Inveran, in Gaelic Inbhiran (in youren). Inbhiran is the
diminutive of Inbhir (inver), an estuary, or mouth of. Inveran
therefore means the little estuary. It takes this name from the
small estuary formed where the little river from Kernsary enters
Loch Maree.
Inverasdale, should be spelt Inbhirasdal (in-ur-astle), Mouth of
the river Asdaile. Called Ashfidill, Aspedell, or Absdill in old
documents.
Inverewe, Anglicé for Inbhiriu (in yer ew), The mouth of the
Ewe. Inver (Gallice Inbhir), mouth of a river.
Judha. See Feill Iudha. There is no word beginning with J in
Gaelic.
Kenlochewe (kinloch ew). See Ceann loch iu. The letter k does
not occur in true Gaelic.
Kenneth. English form of Coinneach, which see.
Kernsary, spelt in Gaelic Cearnsair. A corruption, probably from
carn, a cairn; aridh, a shieling.
Kerry, properly spelt Cearridh. Meaning unknown; may be
connected with cearr, left, or wrong.
Kerrysdale. A modern English name; in Gaelic it is called Cathair
Bheag, or the little seat or green knoll on which the fairies used
to sit. Compare similar word in Welsh, as in Cader Idris. Bheag
is possessive of beag, little.
Kintail. See Ceann an t' sail.
Laide (laide), a slope. From leathad (pronounced laid), a slope.
The place is called in Gaelic Leathad Udrigil, or The slope of
Udrigil.
Lasan (larsan), a slight passion, wrath, anger.
Leabaidh na Ba Bàine (lyeppy na papann), Bed of the white
cow. Leabaidh, a bed; ba, possessive of bo, a cow; bàine,
possessive of ban, white.
Leabhar na Feinne (leeoar na fainyie), Book of the Fingalians.
Leac nan Saighead (lake nen side), Flag or flat rock of the
arrow. Leac, a flat rock, a flag; saighead, an arrow.
Leacaidh (lyechy), Place of flags, or flat rocks.
Leitir (laychter, letter), slope on a hill side, declivity.
Leth chreag (laychrig), Half rock. Leth, half; chreag, possessive
of creag, a rock. This name is applied to several rocky hills in
Gairloch; it seems to imply that one-half of the rock has fallen
away.
Letterewe (letter ew), Slope of Ewe. See Leitir. This name is
properly Leitir Iu.
Leum an Doill (layum an toul), Blind man's leap.
Lews (looze). From Leogheas (leoas), i.e., the lands of Leod,
the progenitor of the MacLeods of the Lews.
Liathgach (leeroch), The light-blue mountain. Liath, light blue.
This name should not have Beinn before it.
Loch (loch), a lake, an arm of the sea. Lochan, a small lake, a
tarn.
Loch a Bhaid Luachraich (loch a vat loocharar), Loch of the
clump of rushes. Bad, a clump; luachair, rushes.
Loch a Bheallaich (loch a veealoch), Loch of the pass. Beallach,
a pass.
Loch a Chroisg (loch ach roshk). Anglicé Loch Rosque. Chroisg,
possessive of Crosg, name of a place. Meaning unknown;
possibly connected with Crasg, which see. Another suggestion is
that Crosg may mean the Cross, and that the name was given
by ecclesiastics who unquestionably lived here.
Loch a Druing (loch a tring), Loch of Druing. Druing is probably
a Norse word. It occurs as Druingag in Tobar Druingag, The well
of Druingag, which is at the south end of Loch a Druing.
Loch an Iasgair (loch an ee-esker), Loch of the fisherman.
Iasgair, a fisherman; but in this case it refers to the nesting
here of the osprey or fishing eagle.
Loch Bad na Sgalaig (loch bat na skallak), Loch of the servant's
grove. [Bad, a grove (or clump); sgalag, a servant.
Loch Bad na h' Achlais (loch pat 'n achlass), Loch of the grove
of the hollow. Achlais, a hollow, the armpit.
Loch Bharanaichd (loch varranocht), Loch of the barony.
Baranachd, a barony.
Loch Broom (loch broom). An English imitation of the Gaelic
name, which is Loch Bhraoin (loch vruin). Braon means a light
shower, drops of rain, drizzle.
Loch Clair, properly Clar (loch clar). Means anything flat, as the
head of a barrel, leaf of a table, the front or plain piece of a kilt.
The stone tables of the law are called clar in the Gaelic bible.
Loch Coulin (loch koalin). Coulin (or Connlin) is from Connlach,
a Fingalian hero, who was buried on a promontory in the loch.
The site of his grave is still pointed out.
Loch Fada (loch fatter), Long loch. Fada, long.
Loch Fear, Feur, Feir, or Fiar. See Fear loch.
Loch Gharbhaig (loch garravaik), Loch of the Garavaig, which
see.
Loch Maree. See St Maelrubha.
Loch Mhic 'ille Rhiabhaich (loch vik illie reeoach), Loch of
MacGille Riabhach, whom see.
Loch na Beiste (loch na peyest), Loch of the beast. Beist, a
beast, a brute.
Loch na h' Oidhche (loch na hayich), Loch of night. Oidhche,
night.
Loch nan Dailthean (loch nan dullann), Loch of the meadows.
Dail, a field, a meadow.
Loch Rosque. See Loch a Chroisg.
Loch Torr na h' Eiginn (loch torr na haykin), Loch of the mound
of violence. Torr, a mound; eiginn, violence.
Lochan a' Neigh. Should be Lochan an Fheidh, which see.
Lochan an Fheidh (lochan a neay), Loch of the deer. Fheidh,
possessive of fiadh, deer.
Lochan Cul na Cathrach (lochan cool na karroch), Tarn of [or at]
the back of the fairies' seat. Cul, back of; cathrach, possessive
of cathair, a seat, a word usually applied to the fairies' seats.
Lochan nan Airm (lochan nan arram), Loch of the arms. Airm,
possessive of aram (or armachd), arms.
Lochan nan Breac, or Lochan nan Breac Adhair (lochanan brake
aar), Lochan of the trout from the sky. Adhar, the sky. When
trout are found in a loch without inlet or outlet, they are
supposed to have fallen from the sky.
Lochend (Dog Gaelic), End of the loch.
Londubh (lonedhoo), Black bog. Lon, a bog; dubh, black.
Longa (longer). Norse name; the termination a is an old Norse
suffix meaning an isle. Long may be Norse equivalent to the
English long, or it may possibly be the Gaelic long, a ship. In old
maps it is called Lunga.
Lonmor (lone more), Big bog. Lon (lone), a bog; mor, big.
Luibmhor (loopmore), Great bend [or loop]. Luib, a bend.
Lungard (lungard). An old name; meaning unknown.
Mac (mak), Son of. Possessive mhic (vik), of the son of.
Mac a Ghille Riabhaich (mak illie ree-oach), Son of Gille
Riabhach. See Gille Riabhach.
Mac Callum (makallum), Son of Malcolm.
Mac Coinnich (mak kunnich), Son of Kenneth. Mac, son of;
Coinnich, possessive of Coinneach, which see.
Mac Ghille Challum (mak illie Challum), The son of the lad
Malcolm. Ghille, possessive of Gille; Challum, possessive of
Callum, Malcolm.
Mac Gilleandreis (mak gilloundris), Son of the servant of [St]
Andrew. Gille, a servant; Aindrea, or Andreis, Andrew.
Mac Gillechriosd (mak gillie chree-est), Son of the servant of
Christ. Chriosd, Christ. See Gille.
Mac Iain Dhuibh (mak an ooie), Son of Black John. Mac, son of;
dhuibh, possessive of dubh, black.
MacLean (mak laine). In Gaelic this name is Mac'ill'ean, possibly
for Mac Ghille Iain, meaning the son of the servant of John, or
St John.
MacLennan (maklennan). In Gaelic the name is Mac a Leinnan,
from leine, a shirt, referring to the first MacLennan having been
the armour bearer who carried his "shirt" of mail for Mackenzie,
lord of Kintail.
Mac Leod (makloud), the Son of Leod, progenitor of all the
MacLeods.
Mac Mhic Cordaigh (mak vik orday), Son of the son of Cordaigh.
Mac Olamh Mhor (mak olar vor), Son of Olaf the Great. Olaf, a
Norse name.
Macdonald, The son of Donald. It is not used in this form in
Gaelic. The proper Gaelic equivalent is Domhnullach
(donnulloch); it also means, the son of Donald. Mac Dhomhnuill
is, however, frequently used.
MacRae (mak ray), Son of fortune. Mac, son of; rath, fortune.
Maighdean (maidchen), Maiden.
Maighstir Sgoil (maishter skol), Schoolmaster. Maighstir, a
master; sgoil, a school.
Mali chruinn donn (mallie cruntown), Round brown Molly. Mali,
Molly; cruinn, round; donn, brown.
Maolmuire (melmur), Tonsured one of Mary. Maol, a cropped
head; muire, the virgin [Mary].
Marbhrann (marvran), an elegy. Marbh, dead; rann, verse.
McKenzie or Mackenzie. Corrupted from Mac Coinnich, which
see.
Meall (meoul), a hill; literally a lump, usually applied to a lump
of a hill. Meallan, a little hill.
Meall a Deas, (mella teyess), Hill of the south. Deas, south.
Meall a Ghuibhais (meyoul a huish), Hill of the fir. Guibhas, a fir.
Meall an Doire (meyoul an derry), Hill of the grove.
Meall Aridh Mhic Craidh (meyoul arry vik creear), Hill of the
shieling of Criadh. Aridh, a shieling; Criadh, name of a man,
meaning unknown.
Meall Aundrairidh (meyoul aurndrarey). Possibly meant for hill of
Andrew, or of Andrew's shieling; if the latter, the termination
would be from aridh, a shieling.
Meall Lochan a Chleirich (meyoul lochan a chlearich), Hill of the
loch of the priest. Cleireach, a clerk. The priests were
sometimes called cleireach, from their scholarship.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like