100% found this document useful (3 votes)
29 views

Immediate download R Programming for Data Science Roger D. Peng ebooks 2024

Programming

Uploaded by

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

Immediate download R Programming for Data Science Roger D. Peng ebooks 2024

Programming

Uploaded by

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

Get ebook downloads in full at ebookmeta.

com

R Programming for Data Science Roger D. Peng

https://ebookmeta.com/product/r-programming-for-data-
science-roger-d-peng/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

The Art of Data Science Roger D. Peng

https://ebookmeta.com/product/the-art-of-data-science-roger-d-peng/

ebookmeta.com

Functional Programming in R 4: Advanced Statistical


Programming for Data Science, Analysis, and Finance -
Second Edition Thomas Mailund
https://ebookmeta.com/product/functional-programming-in-r-4-advanced-
statistical-programming-for-data-science-analysis-and-finance-second-
edition-thomas-mailund/
ebookmeta.com

R Programming for Actuarial Science 1st Edition Mcquire

https://ebookmeta.com/product/r-programming-for-actuarial-science-1st-
edition-mcquire/

ebookmeta.com

Cultural Histories of Ageing Myths Plots and Metaphors of


the Senescent Self 1st Edition Margery Vibe Skagen
(Editor)
https://ebookmeta.com/product/cultural-histories-of-ageing-myths-
plots-and-metaphors-of-the-senescent-self-1st-edition-margery-vibe-
skagen-editor/
ebookmeta.com
Introduction to Banking 3rd Edition Claudia Girardone

https://ebookmeta.com/product/introduction-to-banking-3rd-edition-
claudia-girardone/

ebookmeta.com

An Analysis of Geoffrey Parker s Global Crisis War Climate


Change and Catastrophe in the Seventeenth Century 1st
Edition Ian Jackson
https://ebookmeta.com/product/an-analysis-of-geoffrey-parker-s-global-
crisis-war-climate-change-and-catastrophe-in-the-seventeenth-
century-1st-edition-ian-jackson/
ebookmeta.com

Cross my Heart Steamy in Sweetville 10 1st Edition Haven


Rose

https://ebookmeta.com/product/cross-my-heart-steamy-in-
sweetville-10-1st-edition-haven-rose/

ebookmeta.com

The Bitcoin Dilemma: Weighing The Economic And


Environmental Costs And Benefits 1st Edition Colin L. Read

https://ebookmeta.com/product/the-bitcoin-dilemma-weighing-the-
economic-and-environmental-costs-and-benefits-1st-edition-colin-l-
read/
ebookmeta.com

Pennsylvania Dutch The Story of an American Language 1st


Edition Mark L. Louden

https://ebookmeta.com/product/pennsylvania-dutch-the-story-of-an-
american-language-1st-edition-mark-l-louden/

ebookmeta.com
Religious Giving For Love of God 1st Edition David H Smith

https://ebookmeta.com/product/religious-giving-for-love-of-god-1st-
edition-david-h-smith/

ebookmeta.com
R Programming for Data Science
Roger D. Peng
© 2014 - 2016 Roger D. Peng
Also By Roger D. Peng
The Art of Data Science
Exploratory Data Analysis with R
Report Writing for Data Science in R
Contents

1. Stay in Touch! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2. Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

3. History and Overview of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


3.1 What is R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 What is S? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 The S Philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Back to R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.5 Basic Features of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.6 Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.7 Design of the R System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.8 Limitations of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.9 R Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4. Getting Started with R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12


4.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 Getting started with the R interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5. R Nuts and Bolts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


5.1 Entering Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3 R Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.5 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.6 Creating Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.7 Mixing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.8 Explicit Coercion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.9 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.10 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.11 Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.12 Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.13 Data Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.14 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
CONTENTS

5.15 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6. Getting Data In and Out of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24


6.1 Reading and Writing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.2 Reading Data Files with read.table() . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.3 Reading in Larger Datasets with read.table . . . . . . . . . . . . . . . . . . . . . . . 25
6.4 Calculating Memory Requirements for R Objects . . . . . . . . . . . . . . . . . . . 26

7. Using the readr Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

8. Using Textual and Binary Formats for Storing Data . . . . . . . . . . . . . . . . . . . 29


8.1 Using dput() and dump() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.2 Binary Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

9. Interfaces to the Outside World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


9.1 File Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.2 Reading Lines of a Text File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3 Reading From a URL Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

10. Subsetting R Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37


10.1 Subsetting a Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
10.2 Subsetting a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
10.3 Subsetting Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
10.4 Subsetting Nested Elements of a List . . . . . . . . . . . . . . . . . . . . . . . . . . 40
10.5 Extracting Multiple Elements of a List . . . . . . . . . . . . . . . . . . . . . . . . . 41
10.6 Partial Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
10.7 Removing NA Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

11. Vectorized Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44


11.1 Vectorized Matrix Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

12. Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


12.1 Dates in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
12.2 Times in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
12.3 Operations on Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
12.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

13. Managing Data Frames with the dplyr package . . . . . . . . . . . . . . . . . . . . . . 50


13.1 Data Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
13.2 The dplyr Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
13.3 dplyr Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
13.4 Installing the dplyr package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
13.5 select() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
13.6 filter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
13.7 arrange() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
CONTENTS

13.8 rename() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
13.9 mutate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
13.10 group_by() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
13.11 %>% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
13.12 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

14. Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63


14.1 if-else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
14.2 for Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
14.3 Nested for loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
14.4 while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
14.5 repeat Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
14.6 next, break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
14.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

15. Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
15.1 Functions in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
15.2 Your First Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
15.3 Argument Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
15.4 Lazy Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
15.5 The ... Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
15.6 Arguments Coming After the ... Argument . . . . . . . . . . . . . . . . . . . . . 78
15.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

16. Scoping Rules of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80


16.1 A Diversion on Binding Values to Symbol . . . . . . . . . . . . . . . . . . . . . . . 80
16.2 Scoping Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
16.3 Lexical Scoping: Why Does It Matter? . . . . . . . . . . . . . . . . . . . . . . . . . 82
16.4 Lexical vs. Dynamic Scoping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
16.5 Application: Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
16.6 Plotting the Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
16.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

17. Coding Standards for R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

18. Loop Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90


18.1 Looping on the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
18.2 lapply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
18.3 sapply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
18.4 split() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
18.5 Splitting a Data Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
18.6 tapply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
18.7 apply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
18.8 Col/Row Sums and Means . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
CONTENTS

18.9 Other Ways to Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103


18.10 mapply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
18.11 Vectorizing a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
18.12 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

19. Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108


19.1 Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
19.2 Primary R Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
19.3 grep() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
19.4 grepl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
19.5 regexpr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
19.6 sub() and gsub() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
19.7 regexec() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
19.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

20. Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119


20.1 Something’s Wrong! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
20.2 Figuring Out What’s Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
20.3 Debugging Tools in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
20.4 Using traceback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
20.5 Using debug() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
20.6 Using recover() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
20.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

21. Profiling R Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127


21.1 Using system.time() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
21.2 Timing Longer Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
21.3 The R Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
21.4 Using summaryRprof() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
21.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

22. Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133


22.1 Generating Random Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
22.2 Setting the random number seed . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
22.3 Simulating a Linear Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
22.4 Random Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
22.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

23. Data Analysis Case Study: Changes in Fine Particle Air Pollution in the U.S. . . . . . 141
23.1 Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
23.2 Loading and Processing the Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . 141
23.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

24. About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151


1. Stay in Touch!
Thanks for purchasing this book. If you are interested in hearing more from me about things that
I’m working on (books, data science courses, podcast, etc.), you can do two things.
First, I encourage you to join my mailing list of Leanpub Readers¹. On this list I send out updates
of my own activities as well as occasional comments on data science current events. I’ll also let you
know what my co-conspirators Jeff Leek and Brian Caffo are up to because sometimes they do really
cool stuff.
Second, I have a regular podcast called Not So Standard Deviations² that I co-host with Dr. Hilary
Parker, a Senior Data Analyst at Etsy. On this podcast, Hilary and I talk about the craft of data
science and discuss common issues and problems in analyzing data. We’ll also compare how data
science is approached in both academia and industry contexts and discuss the latest industry trends.
You can listen to recent episodes on our SoundCloud page or you can subscribe to it in iTunes³ or
your favorite podcasting app.
Thanks again for purchasing this book and please do stay in touch!
¹http://eepurl.com/bAJ3zj
²https://soundcloud.com/nssd-podcast
³https://itunes.apple.com/us/podcast/not-so-standard-deviations/id1040614570

1
2. Preface
I started using R in 1998 when I was a college undergraduate working on my senior thesis.
The version was 0.63. I was an applied mathematics major with a statistics concentration and
I was working with Dr. Nicolas Hengartner on an analysis of word frequencies in classic texts
(Shakespeare, Milton, etc.). The idea was to see if we could identify the authorship of each of the
texts based on how frequently they used certain words. We downloaded the data from Project
Gutenberg and used some basic linear discriminant analysis for the modeling. The work was
eventually published¹ and was my first ever peer-reviewed publication. I guess you could argue
it was my first real “data science” experience.
Back then, no one was using R. Most of my classes were taught with Minitab, SPSS, Stata, or
Microsoft Excel. The cool people on the cutting edge of statistical methodology used S-PLUS. I
was working on my thesis late one night and I had a problem. I didn’t have a copy of any of those
software packages because they were expensive and I was a student. I didn’t feel like trekking over
to the computer lab to use the software because it was late at night.
But I had the Internet! After a couple of Yahoo! searches I found a web page for something called R,
which I figured was just a play on the name of the S-PLUS package. From what I could tell, R was a
“clone” of S-PLUS that was free. I had already written some S-PLUS code for my thesis so I figured
I would try to download R and see if I could just run the S-PLUS code.
It didn’t work. At least not at first. It turns out that R is not exactly a clone of S-PLUS and quite a few
modifications needed to be made before the code would run in R. In particular, R was missing a lot of
statistical functionality that had existed in S-PLUS for a long time already. Luckily, R’s programming
language was pretty much there and I was able to more or less re-implement the features that were
missing in R.
After college, I enrolled in a PhD program in statistics at the University of California, Los Angeles.
At the time the department was brand new and they didn’t have a lot of policies or rules (or classes,
for that matter!). So you could kind of do what you wanted, which was good for some students and
not so good for others. The Chair of the department, Jan de Leeuw, was a big fan of XLisp-Stat and
so all of the department’s classes were taught using XLisp-Stat. I diligently bought my copy of Luke
Tierney’s book² and learned to really love XLisp-Stat. It had a number of features that R didn’t have
at all, most notably dynamic graphics.
But ultimately, there were only so many parentheses that I could type, and still all of the research-
level statistics was being done in S-PLUS. The department didn’t really have a lot of copies of S-PLUS
lying around so I turned back to R. When I looked around at my fellow students, I realized that I
was basically the only one who had any experience using R. Since there was a budding interest in R
¹http://amstat.tandfonline.com/doi/abs/10.1198/000313002100#.VQGiSELpagE
²http://www.amazon.com/LISP-STAT-Object-Oriented-Environment-Statistical-Probability/dp/0471509167/

2
Preface 3

around the department, I decided to start a “brown bag” series where every week for about an hour
I would talk about something you could do in R (which wasn’t much, really). People seemed to like
it, if only because there wasn’t really anyone to turn to if you wanted to learn about R.
By the time I left grad school in 2003, the department had essentially switched over from XLisp-
Stat to R for all its work (although there were a few hold outs). Jan discusses the rationale for the
transition in a paper³ in the Journal of Statistical Software.
In the next step of my career, I went to the Department of Biostatistics⁴ at the Johns Hopkins
Bloomberg School of Public Health, where I have been for the past 12 years. When I got to Johns
Hopkins people already seemed into R. Most people had abandoned S-PLUS a while ago and were
committed to using R for their research. Of all the available statistical packages, R had the most
powerful and expressive programming language, which was perfect for someone developing new
statistical methods.
However, we didn’t really have a class that taught students how to use R. This was a problem because
most of our grad students were coming into the program having never heard of R. Most likely in
their undergradute programs, they used some other software package. So along with Rafael Irizarry,
Brian Caffo, Ingo Ruczinski, and Karl Broman, I started a new class to teach our graduate students
R and a number of other skills they’d need in grad school.
The class was basically a weekly seminar where one of us talked about a computing topic of interest.
I gave some of the R lectures in that class and when I asked people who had heard of R before, almost
no one raised their hand. And no one had actually used it before. The main selling point at the time
was “It’s just like S-PLUS but it’s free!” A lot of people had experience with SAS or Stata or SPSS. A
number of people had used something like Java or C/C++ before and so I often used that a reference
frame. No one had ever used a functional-style of programming language like Scheme or Lisp.
To this day, I still teach the class, known a Biostatistics 140.776 (“Statistical Computing”). However,
the nature of the class has changed quite a bit over the past 10 years. The population of students
(mostly first-year graduate students) has shifted to the point where many of them have been
introduced to R as undergraduates. This trend mirrors the overall trend with statistics where we
are seeing more and more students do undergraduate majors in statistics (as opposed to, say,
mathematics). Eventually, by 2008–2009, when I’d asked how many people had heard of or used
R before, everyone raised their hand. However, even at that late date, I still felt the need to convince
people that R was a “real” language that could be used for real tasks.
R has grown a lot in recent years, and is being used in so many places now, that I think it’s
essentially impossible for a person to keep track of everything that is going on. That’s fine, but
it makes “introducing” people to R an interesting experience. Nowadays in class, students are often
teaching me something new about R that I’ve never seen or heard of before (they are quite good
at Googling around for themselves). I feel no need to “bring people over” to R. In fact it’s quite the
opposite–people might start asking questions if I weren’t teaching R.
³http://www.jstatsoft.org/v13/i07
⁴http://www.biostat.jhsph.edu
Preface 4

This book comes from my experience teaching R in a variety of settings and through different stages
of its (and my) development. Much of the material has been taken from by Statistical Computing
class as well as the R Programming⁵ class I teach through Coursera.
I’m looking forward to teaching R to people as long as people will let me, and I’m interested in
seeing how the next generation of students will approach it (and how my approach to them will
change). Overall, it’s been just an amazing experience to see the widespread adoption of R over the
past decade. I’m sure the next decade will be just as amazing.
⁵https://www.coursera.org/course/rprog
3. History and Overview of R
There are only two kinds of languages: the ones people complain about and the ones
nobody uses —Bjarne Stroustrup

Watch a video of this chapter¹

3.1 What is R?
This is an easy question to answer. R is a dialect of S.

3.2 What is S?
S is a language that was developed by John Chambers and others at the old Bell Telephone
Laboratories, originally part of AT&T Corp. S was initiated in 1976² as an internal statistical analysis
environment—originally implemented as Fortran libraries. Early versions of the language did not
even contain functions for statistical modeling.
In 1988 the system was rewritten in C and began to resemble the system that we have today (this
was Version 3 of the language). The book Statistical Models in S by Chambers and Hastie (the white
book) documents the statistical analysis functionality. Version 4 of the S language was released in
1998 and is the version we use today. The book Programming with Data by John Chambers (the
green book) documents this version of the language.
Since the early 90’s the life of the S language has gone down a rather winding path. In 1993 Bell Labs
gave StatSci (later Insightful Corp.) an exclusive license to develop and sell the S language. In 2004
Insightful purchased the S language from Lucent for $2 million. In 2006, Alcatel purchased Lucent
Technologies and is now called Alcatel-Lucent.
Insightful sold its implementation of the S language under the product name S-PLUS and built a
number of fancy features (GUIs, mostly) on top of it—hence the “PLUS”. In 2008 Insightful was
acquired by TIBCO for $25 million. As of this writing TIBCO is the current owner of the S language
and is its exclusive developer.
The fundamentals of the S language itself has not changed dramatically since the publication of the
Green Book by John Chambers in 1998. In 1998, S won the Association for Computing Machinery’s
Software System Award, a highly prestigious award in the computer science field.
¹https://youtu.be/STihTnVSZnI
²http://cm.bell-labs.com/stat/doc/94.11.ps

5
History and Overview of R 6

3.3 The S Philosophy


The general S philosophy is important to understand for users of S and R because it sets the stage for
the design of the language itself, which many programming veterans find a bit odd and confusing.
In particular, it’s important to realize that the S language had its roots in data analysis, and did not
come from a traditional programming language background. Its inventors were focused on figuring
out how to make data analysis easier, first for themselves, and then eventually for others.
In Stages in the Evolution of S³, John Chambers writes:

“[W]e wanted users to be able to begin in an interactive environment, where they


did not consciously think of themselves as programming. Then as their needs became
clearer and their sophistication increased, they should be able to slide gradually into
programming, when the language and system aspects would become more important.”

The key part here was the transition from user to developer. They wanted to build a language that
could easily service both “people”. More technically, they needed to build language that would
be suitable for interactive data analysis (more command-line based) as well as for writing longer
programs (more traditional programming language-like).

3.4 Back to R
The R language came to use quite a bit after S had been developed. One key limitation of the S
language was that it was only available in a commericial package, S-PLUS. In 1991, R was created
by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of Auckland. In
1993 the first announcement of R was made to the public. Ross’s and Robert’s experience developing
R is documented in a 1996 paper in the Journal of Computational and Graphical Statistics:

Ross Ihaka and Robert Gentleman. R: A language for data analysis and graphics. Journal
of Computational and Graphical Statistics, 5(3):299–314, 1996

In 1995, Martin Mächler made an important contribution by convincing Ross and Robert to use the
GNU General Public License⁴ to make R free software. This was critical because it allowed for the
source code for the entire R system to be accessible to anyone who wanted to tinker with it (more
on free software later).
In 1996, a public mailing list was created (the R-help and R-devel lists) and in 1997 the R Core
Group was formed, containing some people associated with S and S-PLUS. Currently, the core group
controls the source code for R and is solely able to check in changes to the main R source tree. Finally,
in 2000 R version 1.0.0 was released to the public.
³http://www.stat.bell-labs.com/S/history.html
⁴http://www.gnu.org/licenses/gpl-2.0.html
History and Overview of R 7

3.5 Basic Features of R


In the early days, a key feature of R was that its syntax is very similar to S, making it easy for
S-PLUS users to switch over. While the R’s syntax is nearly identical to that of S’s, R’s semantics,
while superficially similar to S, are quite different. In fact, R is technically much closer to the Scheme
language than it is to the original S language when it comes to how R works under the hood.
Today R runs on almost any standard computing platform and operating system. Its open source
nature means that anyone is free to adapt the software to whatever platform they choose. Indeed, R
has been reported to be running on modern tablets, phones, PDAs, and game consoles.
One nice feature that R shares with many popular open source projects is frequent releases. These
days there is a major annual release, typically in October, where major new features are incorporated
and released to the public. Throughout the year, smaller-scale bugfix releases will be made as needed.
The frequent releases and regular release cycle indicates active development of the software and
ensures that bugs will be addressed in a timely manner. Of course, while the core developers control
the primary source tree for R, many people around the world make contributions in the form of new
feature, bug fixes, or both.
Another key advantage that R has over many other statistical packages (even today) is its sophisti-
cated graphics capabilities. R’s ability to create “publication quality” graphics has existed since the
very beginning and has generally been better than competing packages. Today, with many more
visualization packages available than before, that trend continues. R’s base graphics system allows
for very fine control over essentially every aspect of a plot or graph. Other newer graphics systems,
like lattice and ggplot2 allow for complex and sophisticated visualizations of high-dimensional data.
R has maintained the original S philosophy, which is that it provides a language that is both useful
for interactive work, but contains a powerful programming language for developing new tools. This
allows the user, who takes existing tools and applies them to data, to slowly but surely become a
developer who is creating new tools.
Finally, one of the joys of using R has nothing to do with the language itself, but rather with the
active and vibrant user community. In many ways, a language is successful inasmuch as it creates a
platform with which many people can create new things. R is that platform and thousands of people
around the world have come together to make contributions to R, to develop packages, and help
each other use R for all kinds of applications. The R-help and R-devel mailing lists have been highly
active for over a decade now and there is considerable activity on web sites like Stack Overflow.

3.6 Free Software


A major advantage that R has over many other statistical packages and is that it’s free in the sense
of free software (it’s also free in the sense of free beer). The copyright for the primary source code
for R is held by the R Foundation⁵ and is published under the GNU General Public License version
⁵http://www.r-project.org/foundation/
History and Overview of R 8

2.0⁶.
According to the Free Software Foundation, with free software, you are granted the following four
freedoms⁷

• The freedom to run the program, for any purpose (freedom 0).
• The freedom to study how the program works, and adapt it to your needs (freedom 1). Access
to the source code is a precondition for this.
• The freedom to redistribute copies so you can help your neighbor (freedom 2).
• The freedom to improve the program, and release your improvements to the public, so that
the whole community benefits (freedom 3). Access to the source code is a precondition for
this.

You can visit the Free Software Foundation’s web site⁸ to learn a lot more about free software. The
Free Software Foundation was founded by Richard Stallman in 1985 and Stallman’s personal web
site⁹ is an interesting read if you happen to have some spare time.

3.7 Design of the R System


The primary R system is available from the Comprehensive R Archive Network¹⁰, also known as
CRAN. CRAN also hosts many add-on packages that can be used to extend the functionality of R.
The R system is divided into 2 conceptual parts:

1. The “base” R system that you download from CRAN: Linux¹¹ Windows¹² Mac¹³ Source Code¹⁴
2. Everything else.

R functionality is divided into a number of packages.

• The “base” R system contains, among other things, the base package which is required to run
R and contains the most fundamental functions.
• The other packages contained in the “base” system include utils, stats, datasets, graphics,
grDevices, grid, methods, tools, parallel, compiler, splines, tcltk, stats4.

⁶http://www.gnu.org/licenses/gpl-2.0.html
⁷http://www.gnu.org/philosophy/free-sw.html
⁸http://www.fsf.org
⁹https://stallman.org
¹⁰http://cran.r-project.org
¹¹http://cran.r-project.org/bin/linux/
¹²http://cran.r-project.org/bin/windows/
¹³http://cran.r-project.org/bin/macosx/
¹⁴http://cran.r-project.org/src/base/R-3/R-3.1.3.tar.gz
Other documents randomly have
different content
CHAPTER XVI
HENRY JEANES, ALIAS JAMES MULLEN

It had been raining heavily when the train drew up at the Cotley
platform, but as I did not know how far I might have to walk I had
put up my umbrella when leaving the station only to put it down
again as I entered the hairdresser’s shop. I was holding the half-
closed umbrella in my hand when my eye caught sight of the two
letters. To sweep them as if by accident into the folds of the
umbrella was the work of a second, and then as I turned quickly
round I saw a man without a hat and wearing a white apron slip out
of the door of a publichouse opposite and run hastily across the road
towards the shop, wiping his mouth with his hand as he did so.
As I expected, he was the proprietor of the establishment, and
after wishing me good-morning and apologising for being out of the
way by explaining that he had been across the road to borrow a
postage stamp, he proceeded to tuck me up in a white sheet
preparatory to cutting my hair.
The demand for postage stamps had evidently been heavy that
afternoon, and the task of affixing them had no doubt resulted in an
uncomfortable dryness of the mouth, which necessitated the
frequent use of liquid. Under the circumstances I considered this
rather fortunate than otherwise, for the man was not unaware of his
condition, and did his best to palliate it by being so obligingly
communicative in regard to any question I asked him that I could,
had I wished it, have acquainted myself with all that he knew about
every customer who patronised his establishment.
“You have letters addressed here sometimes, don’t you?” I asked,
as he was brushing my hair.
“Yes, sir, we ’ave letters addressed ’ere,” he made answer; “but
strictly confidential, of course,” whispering this in my ear with
drunken gravity, and adding, after a pause, with a meaning leer,
“Hand very convenient too, under certain circumstances. Is there
hany little thing you can do for us in that way yourself, sir? If so we
should be ’appy to accept your commission.”
The only little thing I was minded to do for him was to kick him,
and that right heavily, but repressing the unregenerate desire of the
natural man, I affected to be thinking the matter over, and then
replied—
“Why, yes, I think you might. My name is Smithers—Alfred John
Smithers, so if any letters addressed to that name come here you’ll
know they are for me, won’t you?”
“Certainly,” he said. “Only too ’appy to oblige a customer at hany
time. Living ’ere, sir?”
“Staying for a week or so,” I answered, “and I may perhaps come
to live, but am not sure yet. By-the-bye, do you ever get any letters
for my friend Mr. Henry Jeanes?”
“Mr. Henry Jeanes? Oh, yes, sir. And you are the second
gentleman that’s harsked me the same question. Mr. Green ’e
harsked me as well.”
“Mr. James Bakewell Green?” I said. “Oh, yes; he is a friend of
mine too.”
“Hindeed, sir!” (This with a deprecatory cough, as if he did not
think much of the late Mr. Green, and was inclined in consequence to
reconsider the favourable opinion he had apparently formed of
myself.) “Curious gentleman, Mr. Green. Never bought nothing in the
shop, Mr. Green didn’t. Most gentlemen as ’as their letters addressed
’ere takes a bottle of our ’air wash now and then for the good of the
’ouse; but Mr. Green ’e never ’ad as much as a stick of shaving soap
at hany time. ’E was halways harsking questions too, as I told Mr.
Jeanes.”
“Oh,” I said, beginning to see daylight in regard to the means by
which Mullen had got to know that Green was making inquiries
about him. “How did you come to mention the matter to Mr.
Jeanes?”
“Mr. Jeanes ’e left particular word, sir, that if hanybody harsked
after ’im we was to be sure and let ’im know.”
“I see,” I said. “And when do you expect Mr. Jeanes to call again?”
“Mr. Jeanes never calls, sir. We ’aven’t ever seen ’im. ’E sent us
hinstructions that all letters wot come for ’im was to be put in a
henvelope and addressed to ’im at Professor Lawrance’s ’air-cutting
establishment at Stanby, and we was to let ’im know if any one
harsked after ’im.”
At that moment the bell over the tobacconist’s shop outside
announced the entrance of a customer, and two young men pushing
open the swing door of the hairdressing saloon, seated themselves
to await their turn.
Under the circumstances, and especially as I had learnt all I
required, I did not think it wise to ask further questions, but I had a
particular reason—which the reader shall shortly hear—for wishing to
possess a specimen of the handwriting in which the letters for Henry
Jeanes, Esq., that were sent on to the care of Professor Lawrance’s
establishment at Stanby, were directed.
“Can you spare me a second in the outside shop?” I said to the
hairdresser.
“With pleasure, sir,” he answered, following me out. “What can I
do for you?”
“Look here,” I said, pushing half-a-sovereign towards him over the
counter, “that’s for your trouble in letting me have my letters
addressed here. And now another matter. I’ve not been very well to-
day, and want to see a doctor. Who’s the best man to go to?”
“Dr. Carruthers, Devonshire ’Ouse, Grayland Road, sir. Best doctor
in the town, sir,” he responded.
“Would you mind writing it down for me? I’ve got a beastly
memory.”
“With pleasure, sir,” he said, producing a bottle of ink, a pen, and
a sheet of paper from a drawer. “That’s it, sir. Much obliged, sir. I’ll
be very careful about the letters, and good-day, sir.”
CHAPTER XVII
ON THE HEELS OF JAMES MULLEN

I had already decided that my next destination must be Stanby,


where it would be necessary to pay a visit to Professor Lawrance’s
hair-cutting establishment. But first I had to read the letters I had
secured, so I turned into a small quiet-looking hotel and, having
ordered dinner, asked that I might have the use of a bedroom. Then
I rang for a jug of boiling water, and on its arrival I dived into the
folds of my umbrella, and having brought up the two epistles which
were there secreted I proceeded to hold them over the steam until
the gum was so moist that it was possible to open them.
The letter for Green was, as I have said, directed to himself in his
own writing. It contained nothing more important than a sheet of
blank notepaper, which, as the reader will already have surmised,
had evidently been sent as a “blind,” its purpose being to afford the
inquiry agent an excuse for calling at the shop where it had been
delivered.
The letter addressed to Mr. Henry Jeanes—that which had
attracted my attention from the fact of its bearing the postmark of
the very town in Norway where I had reason to believe Mullen’s
sister was staying—promised to be more interesting, and it was with
no little eagerness that I opened it and read as follows:—

“James,—Your letter to hand. I cannot reply at present,


as Stanley has gone to Bergen; but I will write you again
on his return.
“F.”

Though short, and unimportant as regards contents, this letter


was of the highest importance in other respects. Firstly, because it
was evidently from Mrs. Stanley Burgoyne, and intended for the eye
of James Mullen, and so in every way confirmed the genuineness of
the letter I had found in Green’s cigar-case; and secondly, because it
disclosed some information that I might otherwise have had much
difficulty in discovering—the name under which Mullen’s
correspondence was being addressed to him.
It was of the highest importance—if Mullen was to fall into the
trap which I was preparing for him—that he should have no cause to
suspect his correspondence was again being tampered with; so, as it
was possible that Mrs. Burgoyne might refer to this epistle in a later
letter, I carefully resealed the note and handed it to the postman,
whom I saw delivering letters in the street where the shop whence I
had obtained it was situated.
“What’s this?” he said when he had looked at it.
“You dropped it when making your last call,” I answered.
He looked surprised at first, and afterwards suspicious. “I don’t
remember seeing that letter when I sorted my delivery,” he said;
“and I ain’t in the habit of dropping letters in the street—been at it
too long for that. How do I know this ain’t a put-up job?”
“Give it me back at once, you insolent fellow,” I replied, “and I’ll
do what I ought to have done at first—take it to the head office and
report you to the postmaster for negligence. I go out of my way to
do you a courtesy, and perhaps save you from getting into trouble
for carelessness in the execution of your duty, and I get insulted for
my pains. Give it me back, or come with me to the head office and
we’ll soon put this matter right.”
“I humbly ask your pardon, and hope there is no offence, sir, I am
sure,” he answered, with a change of manner which showed that he
did not relish the threat of being reported for negligence. “I’ll see
the letter’s delivered all right, and I’m much obliged to you, sir, I am
sure, and hope you won’t think no more of it.”
“I’m not sure that I oughtn’t to take the letter to the office now,” I
said. “However, I don’t want to get a man into trouble for an
accident, but keep a civil tongue in your head another time, young
man, or you’ll not get off so cheaply as you have this.”
He touched his cap, and promising to profit by my advice, slipped
the letter in with what I supposed were others bearing the same
address; so wishing him good-day I entered a stationer’s shop and
purchased a couple of envelopes and two sheets of paper. Each
sheet of paper I folded and put into an envelope, which I then
addressed in pencil to myself, at the post-office, Stanby. Then, after
posting them, I made my way to the station and took a ticket to
Stanby.
As I had to wait some time for a train, besides changing twice at
junctions, it was late when I reached that town, and I had some
difficulty in finding Professor Lawrance’s hair-cutting establishment,
which was in a side street, and was already closed for the night. On
the other side of the way, and only a few doors down, was a not
very clean-looking temperance hotel and coffee palace, and here I
secured a bedroom and sitting-room, from the latter of which, as it
faced the street, I should be able to keep an eye upon every one
who entered or left Professor Lawrance’s establishment.
I then went to bed, but was up early next morning and called at
the post-office, where the two envelopes which I had posted on the
preceding day at Cotley were awaiting me. These I took with me to
my room at the hotel, and having bought a piece of india-rubber on
the way I rubbed out the pencilled name and address, after which I
re-addressed the envelope in ink to Mr. Henry Jeanes, at Professor
Lawrance’s Hair-cutting Rooms, Stanby, imitating as closely I could
the handwriting of the barber at Cotley, of whose calligraphy I had
secured a specimen.
Most of my readers will already have guessed why I troubled to
post these pencil-addressed letters to myself at Cotley, and then,
after rubbing out the direction, re-addressed them in ink to Jeanes,
at Professor Lawrance’s establishment at Stanby, but as some may
fail to do so, I had better perhaps explain myself.
If a letter for Jeanes should be forwarded on to Professor
Lawrance’s rooms from Cotley, that letter it would be my business,
by hook or by crook, to abstract. But to do this without attracting
suspicion, it would be necessary to have a dummy letter with which
to replace it, and the dummy would have to bear the Cotley
postmark, and be directed in a hand as much resembling the
handwriting on the original letter as possible. How to arrange all this
had puzzled me at first, for though I did not anticipate any difficulty
in hitting upon a pretext by which to obtain a specimen of the Cotley
barber’s handwriting, or in imitating that handwriting when obtained,
I could not see how to get over the difficulty of the postmark. A
postmark is not an easy thing to forge without specially prepared
tools, and until the idea occurred to me of posting at Cotley a letter
addressed in pencil to myself at Stanby, and then rubbing out the
address and re-addressing it to Jeanes, I was rather at a loss to
know how to effect my purpose. However, the difficulty was now
satisfactorily surmounted, and armed with my dummy letters I set
out to make the acquaintance of Professor Lawrance.
He was an extremely unprepossessing, not to say villainous-
looking man, and regarded me with what I could not help thinking
was a suspicious eye when I entered. I submitted to be shaved and
shampooed, both of which operations he performed badly, though
he regaled me meanwhile with his views in regard to the winner of
the Derby, and also of a prize-fight which was coming off that day.
“By-the-bye,” I said, as I was drawing on my gloves, “can one
have letters addressed here?”
“No,” he replied shortly, “yer can’t. It don’t pay—on the usual
terms.”
“I know that,” I said, “or I shouldn’t have asked you. But I’m
willing to pay special terms.”
“Is it ’orses?” he inquired gruffly.
“Yes, horses,” I said, taking up the cue which he had given me;
“but it’s a fool’s game, and I’ve lost a lot of money over it already.”
“Ah!” with a grin. “And yer’ve got a hintroduction, of course. I
don’t take on customers of that sort without a hintroduction. It ain’t
safe.”
The affair was panning out beyond my reckoning, but from what
had transpired I felt sure that I should be safe in assuming he was
more of a betting agent than a barber, and that the wisest thing for
me to do would be, by bluffing boldly, to lead him to suppose I knew
all about him; so I nodded assent as airily as possible, and as if his
question had been a mere matter of course.
“Who is it?” he asked point blank.
“Morrison,” I replied, without a moment’s hesitation—“Henry
Morrison, of Doncaster. You recollect him—tall man, clean-shaven
and small eyes. Wears a fawn coat and a brown billycock. He said
any money I put on with you would be quite safe.”
The barber nodded. “Like as not, though I don’t rekerllect him
from yer description. Well, wot d’yer want me to back?”
“Ah, that’s what I wish you to tell me,” I said—this time at least
with absolute truthfulness, for as a matter of fact I did not know as
much as the name of one of the horses, or what was the race which
we were supposed to be discussing.
“Greased Lightning’s the lay,” he said. “It’s a dead cert. I can get
yer level money now. It’ll be four to two hon to-morrow. How much
are yer going to spring?”
I replied that he could put a “flimsy” on for me; and after he had
entered the amount and my name—which I gave as Henry Watson—
in a greasy notebook, I wished him good morning, promising to call
again soon to see if there were any letters.
The rest of the day I spent for the most part in my bedroom
watching the customers who patronised Professor Lawrance’s
saloon; nor was my vigil without result in assisting me to form an
opinion as to the class of business which was there carried on. Not
more than a dozen people entered the establishment during the day,
and the majority of them had called neither to be shaved nor to
have their hair cut. My reason for coming to this conclusion was not
that I had such telescopic and microscopic eyes as to be able to
detect in every case whether the caller had been under the barber’s
hand since his entrance, but because most of Professor Lawrance’s
customers did not remain inside his shop more than half a minute,
and because, too, I saw a letter in the hand of more than one of
those who came out. And as the postman never passed the door
without making a delivery, and the callers were all more or less
horsey in dress and appearance, the evidence seemed to point
pretty clearly to the fact that Professor Lawrance was, as I had
already surmised, more of a betting agent than a barber.
I looked in next morning, ostensibly to be shaved, but in reality to
try to get sight of any letters which might have come addressed to
the Professor’s care. That worthy forestalled me by gruffly
volunteering the information that there were no letters; nor could I
succeed in leading the conversation to the subject in which I was
interested.
The morning after, however, I waited until I saw some one—who
looked more like a customer in search of a barber than of a betting
agent—enter the shop, and then followed him. He was at that
moment being lathered for shaving, so after wishing the Professor
good-morning, and remarking that I was in no hurry, I took a seat
close to the mantel-shelf and pretended to read the “Daily
Telegraph.” It was on this mantel-shelf, as I was aware, that the box
containing the letters was kept, but on looking round I saw to my
dismay that the mantel-shelf had been cleared for the display of a
big coarsely-coloured picture of “The Great Fight between Slade and
Scroggins.” The picture was labelled, “To be raffled for—the
proceeds for the benefit of the widow.”
Whether this was intended as a delicate way of intimating that the
conflict had proved fatal to one of the conflicting parties, or whether
the widow in question was the relict of the artistic genius whose
brain had conceived and whose hand had drawn the picture, I am
unable to say, as particulars were not given. In regard to the details
of the raffle, however, the promoters of the enterprise had
condescended to be more explicit, as another label announced that
the price of tickets was sixpence, and that they were “to be obtained
of the Professor.” I was, however, more concerned at the moment in
ascertaining what had become of the letters, so I scanned the room
carefully, shifting meanwhile the outspread and interposed
broadsheet of the “Daily Telegraph”—like a yachtsman setting his
canvas close to the wind—so as to keep myself out of reach of the
Professor’s too-inquisitive glance, and switching my eyes from object
to object until they discovered the missing letters placed upon a rack
which hung upon the wall near the window.
“It’s very dark here, or else my sight’s getting bad and I shall have
to take to glasses. I’m hanged if I can read this small print,” I said
aloud, standing up and moving towards the window, as if to get a
better light. For half a minute I pretended to read, and then I
leisurely shook out the newspaper to its fullest extent, in order to
reverse the sheet, thus hiding myself completely from the Professor’s
eye.
As I did so I took the opportunity to snatch the packet of letters
from the rack. It was no easy matter to shuffle through them with
one hand and without attracting attention, but I accomplished the
task successfully, and not without result, for the bottom letter of the
packet was for Mr. Henry Jeanes, and was in the handwriting of the
barber at Cotley.
The reader will remember that I had prepared two envelopes
bearing the Cotley postmark, and addressed to Jeanes in as close an
imitation of the barber’s handwriting as possible. Into one of these
envelopes I had that morning slipped a sheet of blank paper on
which was pasted the newspaper cutting about the finding of the
body of poor Green (I had a reason for doing so which will shortly
transpire), and this envelope I was at that moment carrying just
inside my sleeve. To abstract the original letter and replace it by the
dummy was the work of a few seconds. It was well that I had come
thus prepared, for in the next instant the Professor had snatched the
packet from my hand, and was asking in a voice quivering with fury,
“What the dickens I meant by such impudence?”
“What’s the excitement?” I said, as calmly and unconsciously as
possible. “I was only looking if there was one for me? There’s no
harm done.”
“Oh, isn’t there?” he said. “But there soon will be if yer get
meddling ’ere again,” and with one swiftly-searching and darkly-
suspicious glance at my face he fell to examining the letters, and, as
I could see by the movement of his lips, counting them one by one
to see that none was missing. My heart, I must confess, jumped a
bit when he came to the forgery with which I had replaced the letter
I had abstracted. But the result was apparently satisfactory, for he
put the packet back upon the rack without further comment and
took up the discarded shaving brush to continue his task. I did not
feel at the best of ease when, after the customer had paid and
departed, a surly “Now then!” summoned me to the operating chair,
for it was not altogether reassuring to have a razor, in the grip of
such a ruffian, at one’s throat. But, though the shave was
accomplished with none too light a hand, and the scoundrel drew
blood by the probably intentional and malicious way in which he
rasped my somewhat tender skin, he did me no serious injury, and it
was not long before I was back at the hotel and engaged in opening
the abstracted letter.
There were two documents inside, the first of which was
addressed to Jeanes in Mrs. Stanley Burgoyne’s handwriting, and ran
as follows:—

“James,—We are glad to have your promise, and will


carry out our part of the contract faithfully. We shall
remain here as you direct until you telegraph the word
‘Come,’ when we shall start for England at once, and you
can count on the yacht being at the place you mention
within four days and ready to start again at a few hours’
notice. We shall be just off the boat-builder’s yard where
our little yacht is laid up.
“I do not see any necessity for doing as you say in
regard to sending the present crew back to England under
the pretence that we are not likely to be using the yacht
for some time, and then, after getting the ship’s
appearance altered by repainting and rechristening her
the name you mention, engaging another crew of
Norwegians.
“This seems to me a very unnecessary precaution. Your
connection with us is never likely to be discovered, unless
by your own confession. However, I suppose you know
best, and we will do as you say.
“F.”

The other letter was on a half-sheet of notepaper, and in the


handwriting of the barber at Cotley. Here it is:—

“Respected Sir,—Mr. Green has not called since I last


wrote you. But a person named Smithers came and asked
questions. I did not like the look of him and would not tell
him anything, but said I did not know any Mr. Jeanes.—
Respectfully,
“James Dorley.
“P. S.—Smithers smelt of rum. He had been drinking. He
was a low-looking man, and I did not like his eye.”

“I’m pained to hear you don’t like my eye, Mr. James—Mr. ‘Truthful
James,’” I said sarcastically as I put the letter down, glancing
sideways all the same at a mirror on the wall to see if I could detect
any sinister expression in my eye which could account for the
unfavourable opinion Mr. James had formed of that feature. “And so
you didn’t tell me anything, didn’t you, you precious rascal? Some
day I may have an opportunity of telling you something, and then it
is possible you may find something else to dislike about me as well
as my eye. In the meantime I’ll take the liberty of detaining your
letter, as it would put Mullen on the alert if I let it go on to him. His
sister’s letter he must have, for if I fail to set hands on him here, I
can take him when he keeps his appointment with her on the steam
yacht, on board which he hopes to get out of the country. So I
mustn’t lose a moment in resealing her letter and getting it back by
hook or by crook to the letter-rack whence I got it. I’m not easy
about the forgery with which I replaced it. If there had chanced to
be only two or three letters waiting to be called for this morning,
and I had abstracted one without replacing it with a dummy, the
Professor would be bound to have noticed that a letter was missing.
But I’m running a risk in leaving the forged dummy there a moment
longer than I can help. Mullen might call and have it given him, or it
may get sent on; and though I flatter myself that the forgery is so
well done that even Mullen is not likely to notice any difference in
the handwriting, and though it is possible also that he will think the
cutting about Green’s death had been sent him by the Cotley barber,
I’d much rather that the dummy didn’t fall into his hands.
“To have forged a letter from the Cotley barber would have been
extremely dangerous, for I didn’t then know how the rascal
addressed Mullen. And to have enclosed a blank sheet of paper
would at once suggest the trick which had been played. The
newspaper cutting was the only thing I could think of that had the
look of being a bona fide enclosure from the rascal at Cotley. He had
to my knowledge informed Mullen that Green was inquiring about
him, and what was more natural than that, seeing a notice of
Green’s death in the papers, he should send it on to his principal.
But all the same, the sooner I get the dummy back into my own
hands the better, for I don’t think—”
At this point I broke off my meditations abruptly. I had been
sitting in full view of Professor Lawrance’s door, and just then I saw
him put his head out, look up and down the street as if to see
whether he could safely be away for a few minutes without the
probability of a customer popping in, and then cross the road in the
direction of the nearest publichouse.
“If I’m to make the exchange, it’s now or never,” I said, snatching
up the letter from Mrs. Burgoyne which, after copying, I had put
back into its envelope and resealed. In another half-minute I had
crossed the road and was ascending the stairs which led to Professor
Lawrance’s hair-cutting establishment.
CHAPTER XVIII
I BECOME A HAIRDRESSER’S ASSISTANT

To replace the dummy letter by the original and to pocket the former
did not take long, and as no step upon the stair announced the
Professor’s return I thought I might as well avail myself of the
opportunity of ascertaining anything that was to be learnt about his
other correspondents. With this end in view I put out my hand to
take down the packet again when a voice behind me said:—
“Wot a hinterest he do take in correspondence to be sure. Be
damned if he ain’t at ’em again!” And as I turned round I saw the
Professor in the act of closing the door, locking it, and putting the
key in his pocket.
“Now then, Mr. ’Enery Watson,” he said, with an ugly look upon his
face, “you and me ’as got to come to a hunderstanding. You comes
here very haffable like a-wanting to back a ’orse, with a
hintroduction from Mr. ’Enery Morrison, o’ Doncaster. Tall man, clean-
shaved, small heyes, wore a fawn coat and a billycock ’at, did he?
Ah! I knows ’im—Valker’s ’is name. ’Orses!”—this with scorn too
withering to be expressed by means of pen and ink—“You know
hanythink about ’orses! Why, yer sneakin’ goat, there ain’t a knacker
in the cats’-meat yard wot wouldn’t put ’is ’eels in yer face if ’e ’eard
yer talk about a gee-gee!”
He looked me up and down contemptuously for a moment, and
then with a sudden accession of fury, and with the sneer in his voice
changed to a snarl, said:—
“Yer come ’ere, do yer, a-spying and a-prying, and takes rooms
over the way to keep a watch upon me and my customers. And yer
want to get yer ’and on them letters there, so as to find some
hevidence to lay hinformation agin me, do yer? Think I didn’t know
yer was a-watchin’ me through the korfey palis winder? That’s wot I
went out for. I knew as yer’d be slippin’ over ’ere direckly my back
was turned. But I copped yer, yer slinkin’ toad! and yer ain’t got
nothink to lay hinformation on; and I’ll take care yer don’t!”
“My good man,” I replied quite coolly, “don’t distress yourself
unnecessarily. I know very well that you are carrying on illegal
transactions, and I could make things uncomfortable if I chose to
give the police a hint. But I’m not a detective, and I don’t concern
myself one way or the other with your doings, legal or illegal. What I
came here to find out is purely a private family affair, and has
nothing in the world to do with you or your betting business. A man
I know has disappeared, and his family are anxious to get news of
him. I’ve got an idea that he is in Stanby, and that he is having
letters addressed to your care under an assumed name. Now look
here. You’ve got it in your power to spoil my game, I admit; and I’ve
got it in my power to give the police a hint that might be
inconvenient to you. But why should you and I quarrel? Why
shouldn’t we do a little business together to our mutual benefit? I
can pay for any help you give, and if you’ll work with me I’ll
guarantee that your name shan’t be mentioned, and to keep my
mouth shut about any little business transactions of your own which
you’re engaged in. Well, what is it to be? Will you accept my offer or
not? You get nothing by refusing, and gain a good deal by accepting.
You run this show to make money, and not for pleasure, I take it;
and I’m ready to put a good deal more money in your pocket than
you’d make in the general way, and not to interfere with your usual
business either. I shouldn’t have supposed it wants much thinking
about.”
“Wot d’ yer call a good deal more money?” he asked shortly, but
not without signs of coming to terms.
“Five, fifteen, or twenty pounds.”
“An’ who is it yer after? There’s some of my pals as I wouldn’t give
no one the bulge on, and there’s some as I don’t care a crab’s claw
abawt.”
“My man isn’t one of your pals, I’m pretty sure, though I can’t tell
you his name—anyhow, not for the present,” I answered. “But who
are the pals you won’t go back on?”
“Is it George Ray?”
“No.”
“’Appy ’Arry?”
“No.”
“Alf Mason?”
“No.”
“Bob the Skinner?”
“No.”
“Fred Wright?”
“No.”
“Give us yer twenty pun’ then. I’m on. I don’t care the price of ’arf
a pint about none of the others.”
“Not so fast, my friend; you’ve got to earn the money before you
get it. And it’ll depend on yourself whether it’s ten, fifteen or twenty.
Now listen to me. What I want you to do is to make an excuse for
me to stay in your shop, so as to get a look at the people who come
for letters. You must pretend to engage me as your assistant, and fix
me up in a white apron, and so on. If any one asks questions you
can say I’m a young man who’s come into a little money and wants
to drop it in starting a hairdressing establishment, and I’ve come to
you to help me do it. You can tell them that you don’t let me cut any
of your regular customers, but that I make myself useful by
stropping the razors, lathering the ‘shaves,’ and practising hair-
cutting on odd customers and schoolboys. I could do that much, I
think, without betraying myself. The sooner we begin the better.
Give me a white apron, if you’ve got one to spare, and I’ll put it on
straight off. Here’s five pounds down to start with, and I’ll give you
another five for every week I’m here. Is it a bargain?”
“No, it ain’t. Ten pun’ down, and ten pun’ a week’s my figger, and
no less. I ain’t a-going to injure my business by taking hamitoors to
learn the business on my customers out of charity. Them’s my terms.
Yer can take ’em or leave ’em, as yer like.”
In the end we compounded the matter for ten pounds down and
five pounds weekly, and having arrayed myself in a white apron and
a canvas coat, braided red, which the Professor tossed me from a
drawer, I assumed those badges of office—the shears, shaving-brush
and comb—and took my place behind the second operating chair to
await customers and developments.
CHAPTER XIX
“ARE THERE ANY LETTERS FOR HENRY
JEANES, PLEASE?”

Were it not that they have no immediate connection with my story, I


should like to describe here some of the curious and amusing
experiences which befell me while I was acting as assistant to a
barber and betting agent. But in a narrative like the present it is
perhaps best that I should confine myself to the incidents and
adventures which have direct bearing upon my search for Captain
Shannon.
That the Professor would betray me to his clients I did not think at
all likely, as to do so would necessitate his admitting to them that he
had been bribed to allow a spy, if not a detective, to enter his
service under a disguise, and to have access to the correspondence
of the establishment. At the same time, I did not think it advisable—
at all events for the present—to take him into my confidence by
telling him who was the object of my search. Hence I had to pursue
my investigations in a more or less indirect manner, inquiring first
about one of the parties for whom letters came and then about
another, and so getting an opportunity to refer to Jeanes without
appearing to be more curious about him than about the others. In
reply to my casual question as to who Jeanes was, the Professor
replied, with apparent indifference, that the party in question was
young and good-looking, and that he did not suppose the
correspondence which was being carried on meant any more than a
foolish love-affair.
Several days went by, and the letter for Jeanes still remained
uncalled for, until one afternoon the Professor asked me, as he had
asked me on previous occasions, if I would keep an eye to the shop
while he ran over the way to get half-a-pint. I nodded assent, and,
promising that he would not be long, he disappeared down the
stairs, only to return immediately afterwards for his pipe, which was
lying on the mantel-shelf. As he passed the rack he took the letters
down and ran through them as if to see how many there were, and
then giving me a look, which I took to mean that it would be no use
my tampering with them in his absence, he again descended the
stairs in search of the desired refreshment.
He had been gone about a quarter of an hour when a man,
muffled up to the nose with a big “comforter,” and with a soft hat
pulled down so closely over his brows that little more of him was
visible than a pair of blue spectacles, opened the door and, without
coming in, stood coughing and panting like a consumptive on the
mat outside. As he did not show any disposition to enter, I inquired
what he wanted, but shaking his head, as if to indicate that he was
unable to answer, he continued hacking and coughing with stooped
head and bent shoulders for half a minute, and then in a hollow
voice, which seemed strangely familiar to me, asked if there was a
letter for Mr. Henry Jeanes.
As calmly as if his coming were a thing of the utmost indifference
to me I reached for the packet of letters in order to select that which
was addressed to Jeanes. To my dismay I found it gone, but
repressing the exclamation of surprise which rose to my lips I turned
to the waiting messenger and shook my head.
He mumbled something that sounded like “Thank you,” and then,
closing the door, toiled painfully downstairs. Scarcely had he reached
the first landing before I had made what is called in music-hall
parlance a “lightning change.”
Tearing off my canvas coat and white apron and tossing them in a
heap upon a chair, I shot into, rather than got into, my reefer jacket,
and snatching at my hat was down the stairs and out in the street
before my visitor was half-way to the first corner, which led to an
unfrequented side street. The instant he had turned it I was after
him like the wind, and, looking warily round, saw him making for a
narrow lane that ran at right angles to the direction in which he was
going. No sooner was he hidden by the corner than I was after him
once again, but not so hurriedly as to forget to stop and peer
cautiously round before exposing my own person to view. The sight
which met my eyes put me, I must confess, fairly out of
countenance, for there, just round the corner, with the crush hat
pushed to the back of his head, the muffler thrown open and the
blue spectacles in the hand which he pointed derisively at me, was
none other than the Professor, literally rolling about with
uncontrollable laughter.
“Oh, my poor korf! it is so bad I ain’t able to speak!” he gasped
between his convulsions of merriment. “Ha, ha, ha, ha, ha! Oh, you
’a’porth o’ pigeon’s milk wot thought you could get up early enough
in the mornin’ to take a rise out of old Tom Lawrance! Ha, ha, ha,
ha, ha! Oh, you feedin’-bottle fool and mug as thought yer’d got the
bulge on Downy Tom! Ha, ha, ha, ha, ha! Come and laugh at him,
sonnies, for the biggest fool and mammy’s-milk Juggins and Johnny
in all Stanby!”
CHAPTER XX
HOW JAMES MULLEN AND MYSELF ALMOST
MET

The Professor was in such huge good humour at the success of his
ruse that when we returned together to the hair-cutting
establishment he was almost inclined to be genial, especially as I
took the joke in good part, and frankly admitted that I had never
been so “let through” before. So friendly was he, in fact that he
readily agreed to my proposal that I should go over the way and
bring back a bottle of something to ease his cough; and after I had
pledged “Downy Tom,” and expressed the intention of getting up a
little earlier in the morning the next time I meant trying to steal a
march upon him, and “Downy Tom” had pledged me in what—in
delicate allusion to recent events—he humorously termed pigeon’s
milk, but which was in reality the best Old Tom, we fell to discussing
events almost confidentially.
“So it is Jeanes as yer after—as I always suspected, though you
never harsked questions about him direct, but only as if by haccident
and among the others” he said, as he lit his pipe. “It ’ud have saved
a lot of trouble if yer’d told me so at fust.”
“What do you mean by ‘saved trouble’?” I asked.
“Why, if I’d ’ave knowed it was Jeanes for certain, I’d ’ave ’elped
yer—for a consideration, of course. I only took yer into the shop
because I meant to find out who yer was hafter. Jeanes ain’t nothink
to me; but there is some of my pals as I wouldn’t have no ’arm
come to, not for a pot o’ money. And I knew if I ’ad yer there I could
find out who it was yer wanted, and give ’im the tip if it was a pal.
Why, I’ve been a-playin’ with yer all this time—a-playing hoff first
one name and then another to see if it was your bloke. Then when I
began to suspect it was Jeanes, I planned the little game I played
yer ter-day—an’ didn’t yer tumble prettily! Ha, ha, ha, ha!” and off
the Professor went again into a paroxysm of laughter at my
expense.
It suited my purpose to humour him, so I joined good-humouredly
in the laugh against myself; but as a matter of fact I had not been
quite such a “pigeon” as the Professor supposed. Up to a certain
point the scoring had been in my favour, and not in his, for I had
succeeded, not only in intercepting an important letter which had
been sent to his care, but also in returning that letter—after I had
made myself acquainted with its contents—to the place whence I
took it, so that it might reach the hand of the person to whom it was
addressed.
But I knew very well that, should the Professor’s suspicions be
once aroused—as must have been the case after he detected me in
the act of examining the letters—I should not only never again be
allowed to go within the reach of the rack where he kept them, but
should in all probability be refused admission to his shop. Hence I
had no choice but to adopt the somewhat daring course of openly
offering him a bribe to take me into his service. If he really were
Mullen’s confederate he would already have had cause to suspect my
motives, but if, on the other hand, Mullen and the Professor had no
other connection than that the former was having his letters
addressed to the latter’s shop, it was quite within the bounds of
possibility that the worthy Professor would, for a consideration, be
prepared to tell me all he knew about the customer in question. That
the object of the leading questions he had from time to time put to
me was to discover whom I was in search of, I had been well aware,
although I freely admit that I had been, as I have said, “let through”
in regard to the man who had called for Jeanes’s letter.
When the Professor had had his laugh out I asked him quietly if
he knew that the letter for Jeanes was gone.
“Do I know it’s gone, yer bally fool?” he said. “Why, of course I do.
Wasn’t it me came and called yer for it just now when I had such a
bad korf; and didn’t yer say there wasn’t any letter?”
“Yes, yes,” I said, looking rather foolish; “of course I know that
you came and asked for a letter, and that I told you there wasn’t
one, but I didn’t know that you knew that the letter was really
gone.”
“Well, considerin’ as it was me took it when I came back to get my
pipe, I ought ter know,” he answered, and then, with a sudden
change of manner, “Look ’ere, Watson, or whatever yer name is, I
think us two can do a deal together. Yer want to get ’old of ’Enery
Jeanes, don’t yer?”
I nodded.
“Supposin’ I knew where ’e was to be found at this very minute,
wot ’ud yer give me for the hinformation?”
“Ten pounds,” I answered.
He snorted.
“Can’t be done under twenty, ready money. Give us yer twenty
and I’ll tell yer.”
“No,” I said. “Take me to where Jeanes is to be found, wherever it
is, and I’ll give you, not twenty, but fifty pounds, as soon as I’m sure
it is the right man. I swear it, so help me God! and I won’t go back
on my word.”
His eyes sparkled.
“Yer a gentleman, I b’lieve,” he said, “and I’ll trust yer. But yer
must keep my name out of it. Now listen. When I went down the
stairs to get that ’arf-pint I met Jeanes a-comin’ up for ’is letters. I
guessed it was ’im yer was after, and I wasn’t going to ’ave no
harrests nor rows in my shop. Besides, if yer wanted ’im bad, I
guessed yer’d be willin’ to drop money on it and if there was any
money to be dropped I didn’t see why I shouldn’t be the one to pick
it up.”
Here was news, indeed! If the Professor was to be believed—and,
notwithstanding my recent experience, I failed to see what motive
he could have for misleading me in this instance—the man I was in
search of had been in the town, and in that very house, scarcely
more than two hours ago! And I had been sitting there idly, when
every moment, every second, was precious!
“Go on! go on!” I said excitedly. “Tell me the rest as fast as you
can. There’s not a moment to spare. I’ll see you don’t lose by it.”
He nodded and continued, but still in the same leisurely way.
“Well, I harsked Jeanes to wait while I fetched the letter. That’s
wot I came back to get my pipe for. Yer remember I took the letters
down and pretended to count ’em? Well, I sneaked it then and gave
it ’im. He gave me a sovereign, and said there wouldn’t be any more
letters comin’ for ’im, and ’e shouldn’t be calling at the shop no
more. Then ’e harsked me wot time the next train left for London,
and I told ’im in a quarter of an hour, and ’e said that wouldn’t do,
as ’e ’adn’t ’ad no lunch and was starvin’ ’ungry. So I told ’im there
wasn’t another for two hours and a ’arf, and ’e said that would do
capital, and where was the best place to get dinner. I told ’im the
Railway Hotel, and ’e went there, ’cos I followed him to make sure.
Then I whipped back and played that little game on yer just to make
sure it was Jeanes yer wanted. And now I guess that fifty pounds is
as good as mine. Jeanes’ll be at the hotel now, or if ’e’s left there we
can make sure of ’im at the station when ’e catches the London
express. Wot d’ yer want him for? Looks a ’armless, pleasant kind of
bloke, and very pleasant spoken.”
“What’s he like?” I said.
“Youngish, fair, and big eyes like a gal’s. Wore a blue serge suit
and a white straw ’at.”
“Clean shaven?” I asked.
“Yes, clean shaved; or any’ow, ’e’d no ’air on ’is face.”
“That’s the man,” I said. “Well, come along, we’ll be off to the
hotel. Do you know any one there, by-the-bye?”
“I knows the chief waiter. ’E often ’as five bob on a ’orse with me.”
“All right. Then you’d better go in first and see your friend the
waiter and find out where Jeanes is. If he heard anybody asking for
him by name in the hall he might think something was wrong and
make a bolt. Then you’d lose your fifty pounds—which would be a
pity.”
The Professor assented, and we started for the Railway Hotel, he
walking in front as if without any connection with me, and I some
twenty paces behind. When the swing doors closed upon his bulky
figure I stopped, as we had arranged, and pretended to look into a
shop window until he should rejoin me.
I had been nervous and excited when we set out, but now that
the crisis had come, and I was so soon to stand face to face with
Henry Jeanes alias James Cross, alias James Mullen, alias Captain
Shannon, I was as cool and collected as ever I was in my life.
The next moment the Professor came hurrying out, with a face on
which dismay was plainly written.
“’E’s been there, right enough,” he said, all in a burst, and with a
horrible oath, his features working meanwhile with agitation, the
genuineness of which there was no mistaking. “But instead of ’aving
lunch, as ’e told me ’e should, the —— ’ad a glass of sherry and
caught the 12.15 express to London, and ’e’s more than got there by
now, rot ’im!”
CHAPTER XXI
HOW I STRUCK JAMES MULLEN’S TRACK

Whether Jeanes, alias Mullen, had noticed any signs of curiosity in


regard to his movements on the Professor’s part, and had
intentionally misinformed that worthy; whether his suspicions had
been aroused by his discovering that he was being shadowed to the
hotel; or whether his change of plans was entirely accidental, I had
no means of knowing; but that my adversary in the game of chess I
was playing had again called “check” just when I had hoped to come
out with the triumphant “mate” was not to be denied. The only
additional information I succeeded in eliciting from the Professor was
that Jeanes had visited the shop some month or so ago and had
arranged that any letters sent there for him should be kept till he
came for them. He had left half-a-sovereign on account and had
called four times, receiving three letters, including that which had
been handed to him by the Professor.
As for that precious rascal, I need scarcely say that I placed no
reliance whatever upon what he said, and had seriously considered
whether the story of his giving Jeanes the letter on the stairs, and
then shadowing his customer to the hotel might not be an entire
fabrication. I did not for a moment believe that he knew who Jeanes
really was, for had he done so he would, I felt sure, have lost no
time in securing the reward by handing the fugitive over to the
police. But I quite recognised the possibility of his being in Jeanes’s
pay, and had seriously asked myself whether the statement that
Jeanes would not be having any more letters addressed to the shop,
and would not be visiting Stanby again, might not be a ruse to get
me out of the way. But that the Professor’s surprise and dismay
when he found Jeanes gone from the hotel were genuine, no one
who had witnessed them could have doubted, and as the
circumstances generally tended to confirm his story, I was forced to
the conclusion that he had, in this instance at all events, told the
truth.
In that case I should be wasting time by remaining longer at
Stanby; so after arranging with the Professor that if Jeanes called
again, or if any other letters arrived for him, the word “News” should
at once be telegraphed to an address which I gave, I packed my bag
and caught the next train to town.
Mullen had called “check” at Stanby, it is true, but I was not
without another move, by means of which I hoped eventually to
“mate” him, and what that move was, the reader who remembers
the contents of the intercepted letters will readily surmise.
In one of those letters the person to whom it was addressed was
told that the steam yacht, by means of which he was to escape
would be lying just off the boat-builder’s yard where the little yacht
was laid up. Any one who did not know from whom the letter was,
or under what circumstances it had been written, would not be any
the wiser for this piece of information. But to one who knew, as I
did, that the writer was the wife of Mr. Stanley Burgoyne, it would
not be a difficult thing to ascertain the name of any small yacht of
which that gentleman was the owner, and the place where it was
likely to be laid up.
Whether Mullen intended to abandon or to carry out the plan he
had formed for making his escape by the help of his sister, I had no
means of knowing. If he suspected that his letters had been
intercepted, he was tolerably sure to abandon the arrangement, or
at all events to change the scene of operations. But if he was
unaware of the fact that I had taken up the thread which poor Green
had dropped, it was possible that he might assume his secret to be
safe now Green was satisfactorily disposed of, and might carry out
his original plan, in which event he would walk of his own accord
into the trap which I was preparing for him. In any case I should be
doing right in making inquiries about Mr. and Mrs. Stanley Burgoyne
and their yacht, and with this end in view I purchased a copy of the
current “Yachting Register.”
Turning to the letter B in the list of owners, I found that Mr.
Stanley Scott Burgoyne’s club was the Royal London, and that he
had two boats, one a big steam yacht called the “Fiona,” and the
other a little five-tonner named the “Odd Trick.” It was no doubt in
the former that Mr. and Mrs. Burgoyne had gone to Norway and by
means of which Mullen was to fly the country, and it was probably to
the latter that Mrs. Burgoyne had referred in her letter.
No one can be led to talk “shop” more readily than your
enthusiastic yachtsman, and it did not require much diplomacy on
my part to ascertain, by means of a visit to the Royal London Club
House in Savile Row—in company with a member—that Mr.
Burgoyne’s little cruiser was laid up at Gravesend, in charge of a
man named Gunnell.
Him I accordingly visited, under the pretext of wanting to buy a
yacht, and after some conversation I remarked casually—
“By-the-bye, I think you have my friend Mr. Stanley Burgoyne’s
five-tonner, the ‘Odd Trick,’ laid up here, haven’t you?”
“I did have, sir,” was the reply, “but Mr. Burgoyne he telegraphed
that I was to let his brother-in-law, Mr. Cross, have the boat out.
That there’s the telegram wot you see slipped in behind the
olm’nack.”
For the second time in the course of this curious enterprise the
information I was in need of seemed to come in search of me
instead of my having to go in search of it. I had felt when I started
out to pursue my inquiries about Mr. and Mrs. Stanley Burgoyne, by
interviewing the waterman Gunnell, that it was quite possible I
might learn something of importance, but I had not expected to
strike the trail red-hot, and so soon, for “Cross,” as the reader may
perhaps remember, was the name by which Mullen was known to his
family. “Mullen” had been used only in connection with the
conspiracy.

You might also like