Instant Download Clojure Data Analysis Cookbook 1st Edition Eric Rochester PDF All Chapters
Instant Download Clojure Data Analysis Cookbook 1st Edition Eric Rochester PDF All Chapters
com
https://ebookname.com/product/clojure-data-analysis-
cookbook-1st-edition-eric-rochester/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/clojure-data-analysis-cookbook-2nd-
edition-eric-rochester/
ebookname.com
https://ebookname.com/product/haskell-data-analysis-cookbook-1st-
edition-nishant-shukla/
ebookname.com
https://ebookname.com/product/emqs-for-the-mrcs-part-a-1st-edition-
sri-g-thrumurthy/
ebookname.com
Epistemology 1st Edition Richard Fumerton
https://ebookname.com/product/epistemology-1st-edition-richard-
fumerton/
ebookname.com
https://ebookname.com/product/jedi-twilight-star-wars-coruscant-
nights-i-1st-printing-edition-michael-reaves/
ebookname.com
https://ebookname.com/product/effective-instructional-strategies-4th-
edition-kenneth-d-moore/
ebookname.com
https://ebookname.com/product/measuring-society-1st-edition-chaitra-h-
nagaraja/
ebookname.com
https://ebookname.com/product/nanocarbons-for-advanced-energy-
storage-1st-edition-xinliang-feng-ed/
ebookname.com
Photographic multishot techniques high dynamic range super
resolution extended depth of field stitching 1st ed
Edition Gulbins
https://ebookname.com/product/photographic-multishot-techniques-high-
dynamic-range-super-resolution-extended-depth-of-field-stitching-1st-
ed-edition-gulbins/
ebookname.com
Clojure Data Analysis
Cookbook
Eric Rochester
BIRMINGHAM - MUMBAI
Clojure Data Analysis Cookbook
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly or
indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies
and products mentioned in this book by the appropriate use of capitals. However, Packt
Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78216-264-3
www.packtpub.com
Reviewers Proofreaders
Jan Borgelin Mario Cecere
Thomas A. Faulhaber, Jr. Sandra Hopper
Charles M. Norton
Miki Tebeka Indexer
Monica Ajmera Mehta
Acquisition Editor
Erol Staveley Graphics
Aditi Gajjar
Technical Editors
Nitee Shetty Cover Work
Nilesh R. Mohite
Dennis John
About the Author
Eric Rochester enjoys reading, writing, and spending time with his wife and kids. When
he's not doing those things, he programs in a variety of languages and platforms, including
websites and systems in Python and libraries for linguistics and statistics in C#. Currently, he's
exploring functional programming languages, including Clojure and Haskell. He works at the
Scholars' Lab in the library at the University of Virginia, helping humanities professors and
graduate students realize their digitally informed research agendas.
Thank you to Bethany Nowviskie and Wayne Graham. They've made the
Scholars' Lab a great place to work, with interesting projects, as well as
space to explore our own interests.
And especially I would like to thank Jackie and Melina. They've been
exceptionally patient and supportive while I worked on this project. Without
them, it wouldn't be worth it.
About the Reviewers
Jan Borgelin is a technology geek with over 10 years of professional software development
experience. Having worked in diverse positions in the field of enterprise software, he currently
works as a CEO and Senior Consultant for BA Group Ltd., an IT consultancy based in Finland.
For the past 2 years, he has been more actively involved in functional programming and as
part of that has become interested in Clojure among other things.
He has been a contributor to, and user of, Clojure and Incanter since their earliest days. The
power of Clojure and its ecosystem (of both code and people) is an important "magic bullet" in
Tom's practice.
Charles Norton has over 25 years of programming experience, ranging from factory
automation applications and firmware to network middleware, and is currently a programmer
and application specialist for a Greater Boston municipality. He maintains and develops a
collection of software applications that support finances, health insurance, and water utility
administration. These systems are implemented in several languages, including Clojure.
Miki Tebeka has been shipping software for more than 10 years. He has developed a
wide variety of products from assemblers and linkers to news trading systems to cloud
infrastructures. He currently works at Adconion where he shuffles through more than 6 billion
monthly events. In his free time, he is active in several open source communities.
www.PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
TM
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book
library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
ff Fully searchable across every book published by Packt
ff Copy and paste, print and bookmark content
ff On demand and accessible via web browser
iii
Table of Contents
iv
Preface
Data's everywhere! And, as it has become more pervasive, our desire to use it has grown
just as quickly. A lot hides in data: potential sales, users' browsing patterns, demographic
information, and many, many more things. There are insights we could gain and decisions we
could make better, if only we could find out what's in our data.
The programming language Clojure will help us. Clojure was first released in 2007 by Rich
Hickey. It's a member of the lisp family of languages, and it has the strengths and flexibility
that they provide. It's also functional, so Clojure programs are easy to reason with. And, it
has amazing features for working concurrently and in parallel. All of these can help us as we
analyze data while keeping things simple and fast.
Clojure's usefulness for data analysis is further improved by a number of strong libraries.
Incanter provides a practical environment for working with data and performing statistical
analysis. Cascalog is an easy-to-use wrapper over Hadoop and Cascading. Finally, when
we're ready to publish our results, ClojureScript, an implementation of Clojure that generates
JavaScript, can help us to visualize our data in an effective and persuasive way.
Moreover, Clojure runs on the Java Virtual Machine (JVM), so any libraries written for Java are
available too. This gives Clojure an incredible amount of breadth and power.
I hope that this book will give you the tools and techniques you need to get answers from
your data.
Preface
Chapter 2, Cleaning and Validating Data, will present strategies and implementations for
normalizing dates, fixing spelling, and working with large datasets. Getting data into a useable
shape is an important, but often overlooked, stage of data analysis.
Chapter 4, Improving Performance with Parallel Programming, will cover using Clojure's
parallel processing capabilities to speed up processing data.
Chapter 5, Distributed Data Processing with Cascalog, will cover using Cascalog as a wrapper
over Hadoop and the Cascading library to process large amounts of data distributed over
multiple computers. The final recipe in this chapter will use Pallet to run a simple analysis on
Amazon's EC2 service.
Chapter 6, Working with Incanter Datasets, will cover the basics of working with Incanter
datasets. Datasets are the core data structure used by Incanter, and understanding them is
necessary to use Incanter effectively.
Chapter 7, Preparing for and Performing Statistical Data Analysis with Incanter, will cover
a variety of statistical processes and tests used in data analysis. Some of these are quite
simple, such as generating summary statistics. Others are more complex, such as performing
linear regressions and auditing data with Benford's Law.
Chapter 8, Working with Mathematica and R, will talk about setting up Clojure to talk to
Mathematica or R. These are powerful data analysis systems, and sometimes we might want
to use them. This chapter will show us how to get these systems to work together, as well as
some tasks we can do once they are communicating.
Chapter 9, Clustering, Classifying, and Working with Weka, will cover more advanced machine
learning techniques. In this chapter, we'll primarily use the Weka machine learning library, and
some recipes will discuss how to use it and the data structures its built on, while other recipes
will demonstrate machine learning algorithms.
Chapter 10, Graphing in Incanter, will show how to generate graphs and other visualizations
in Incanter. These can be important for exploring and learning about your data and also for
publishing and presenting your results.
Chapter 11, Creating Charts for the Web, will show how to set up a simple web application
to present findings from data analysis. It will include a number of recipes that leverage the
powerful D3 visualization library.
2
Preface
The other major piece of software that you'll need is Leiningen 2, which you can download
and install from https://github.com/technomancy/leiningen. Leiningen 2 is a tool
for managing Clojure projects and their dependencies. It's quickly becoming the de facto
standard project tool in the Clojure community.
Throughout this book, we'll use a number of other Clojure and Java libraries, including Clojure
itself. Leiningen will take care of downloading these for us as we need them.
You'll also need a text editor or integrated development environment (IDE). If you already
have a text editor that you like, you can probably use it. See http://dev.clojure.org/
display/doc/Getting+Started for tips and plugins for using your particular favorite
environment. If you don't have a preference, I'd suggest looking at using Eclipse with
Counterclockwise. There are instructions for getting this set up at http://dev.clojure.
org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise.
That is all that's required. However, at various places throughout the book, some recipes will
access other software. The recipes in Chapter 8, Working with Mathematica and R, that relate
to Mathematica will require Mathematica, obviously, and those that relate to R, will require
that. However, these programs won't be used in the rest of the book, and whether you're
interested in these recipes might depend on whether you already have this software available.
Likewise, you don't need to be an expert on data analysis, although you should probably be
familiar with its tasks, processes, and techniques. While you might be able to glean enough
from these recipes to get started, to be truly effective, you'll want to get a more thorough
introduction to this field.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of
information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: " We just need to make sure that the clojure.
string/upper-case function is available."
3
Preface
When we wish to draw your attention to a particular part of a code block, the relevant lines or
items are set in bold:
[ring.middleware.file-info :only (wrap-file-info)]
[ring.middleware.stacktrace :only (wrap-stacktrace)]
[ring.util.response :only (redirect)]
[hiccup core element page]
[hiccup.middleware :only (wrap-base-url)]))
New terms and important words are shown in bold. Words that you see on the screen, in
menus or dialog boxes for example, appear in the text like this: "errors are found in the page
Agents and Asynchronous Actions in the Clojure documentation ".
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or may have disliked. Reader feedback is important for us to develop
titles that you really get the most out of.
4
Preface
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to
get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you would report this to us. By doing so, you can save other
readers from frustration and help us improve subsequent versions of this book. If you find
any errata, please report them by visiting http://www.packtpub.com/submit-errata,
selecting your book, clicking on the errata submission form link, and entering the details of
your errata. Once your errata are verified, your submission will be accepted and the errata
will be uploaded on our website, or added to any list of existing errata, under the Errata
section of that title. Any existing errata can be viewed by selecting your title from
http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt,
we take the protection of our copyright and licenses very seriously. If you come across any
illegal copies of our works, in any form, on the Internet, please provide us with the location
address or website name immediately so that we can pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at questions@packtpub.com if you are having a problem with any
aspect of the book, and we will do our best to address it.
5
Importing Data for
1
Analysis
In this chapter, we will cover:
Introduction
There's not a lot of data analysis that we can do without data, so the first step in any project is
evaluating what data we have and what we need. And once we have some idea of what we'll
need, we have to figure out how to get it.
Importing Data for Analysis
Many of the recipes in this chapter and in this book use Incanter (http://incanter.org/)
to import the data and target Incanter datasets. Incanter is a library for doing statistical
analysis and graphics in Clojure, similar to R. Incanter may not be suitable for every task—later
we'll use the Weka library for clustering and machine learning—but it is still an important part
of our toolkit for doing data analysis in Clojure. This chapter has a collection of recipes for
gathering data and making it accessible to Clojure. For the very first recipe, we'll look at how
to start a new project. We'll start with very simple formats like comma-separated values (CSV)
and move into reading data from relational databases using JDBC. Then we'll examine more
complicated data sources, such as web scraping and linked data (RDF).
We'll use Leiningen for that (http://leiningen.org/). This has become a standard
package automation and management system.
Getting ready
Visit the Leiningen site (http://leiningen.org/) and download the lein script. This will
download the Leiningen JAR file. The instructions are clear, and it's a simple process.
How to do it...
To generate a new project, use the lein new command, passing it the name of the project:
$ lein new getting-data
Generating a project called getting-data based on the 'default' template.
To see other templates (app, lein plugin, etc), try 'lein help new'.
Now, there will be a new subdirectory named getting-data. It will contain files with stubs
for the getting-data.core namespace and for tests.
8
Chapter 1
How it works...
The new project directory also contains a file named project.clj. This file contains
metadata about the project: its name, version, and license. It also contains a list of
dependencies that our code will use. The specifications it uses allows it to search Maven
repositories and directories of Clojure libraries (Clojars, https://clojars.org/) to
download the project's dependencies.
(defproject getting-data "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]])
In the Getting ready section of each recipe, we'll see what libraries we need to list in the
:dependencies section of this file.
Getting ready
First, let's make sure we have the correct libraries loaded. The project file of Leiningen
(https://github.com/technomancy/leiningen), the project.clj file, should
contain these dependencies (although you may be able to use more up-to-date versions):
:dependencies [[org.clojure/clojure "1.4.0"]
[incanter/incanter-core "1.4.1"]
[incanter/incanter-io "1.4.1"]]
Finally, I have a file named data/small-sample.csv that contains the following data:
Gomez,Addams,father
Morticia,Addams,mother
Pugsley,Addams,brother
Wednesday,Addams,sister
…
9
Importing Data for Analysis
How to do it…
1. Use the incanter.io/read-dataset function:
user=> (read-dataset "data/small-sample.csv")
[:col0 :col1 :col2]
["Gomez" "Addams" "father"]
["Morticia" "Addams" "mother"]
["Pugsley" "Addams" "brother"]
["Wednesday" "Addams" "sister"]
…
2. If we have a header row in the CSV file, then we include :header true in the call to
read-dataset:
How it works…
Using Clojure and Incanter makes a lot of common tasks easy. This is a good example of that.
We've taken some external data, in this case from a CSV file, and loaded it into an Incanter
dataset. In Incanter, a dataset is a table, similar to a sheet in a spreadsheet or a database
table. Each column has one field of data, and each row has an observation of data. Some
columns will contain string data (all of the columns in this example did), some will contain
dates, some numeric data. Incanter tries to detect automatically when a column contains
numeric data and coverts it to a Java int or double. Incanter takes away a lot of the pain
of importing data.
There's more…
If we don't want to involve Incanter—when you don't want the added dependency, for
instance—data.csv is also simple (https://github.com/clojure/data.csv).
We'll use this library in later chapters, for example, in the recipe Lazily processing very
large datasets of Chapter 2, Cleaning and Validating Data.
10
Chapter 1
See also
ff Chapter 6, Working with Incanter Datasets
Because JSON is a much fuller data model than CSV, we may need to transform the data.
In that case, we can pull out just the information we're interested in and flatten the nested
maps before we pass it to Incanter. In this recipe, however, we'll just work with fairly simple
data structures.
Getting ready
First, include these dependencies in the Leiningen project.clj file:
:dependencies [[org.clojure/clojure "1.4.0"]
[incanter/incanter-core "1.4.1"]
[org.clojure/data.json "0.2.1"]]
And have some data. For this, I have a file named data/small-sample.json that looks
like the following:
[{"given_name": "Gomez",
"surname": "Addams",
"relation": "father"},
{"given_name": "Morticia",
"surname": "Addams",
"relation": "mother"}, …
]
11
Importing Data for Analysis
How to do it…
Once everything's in place, this is just a one-liner, which we can execute at the REPL
interpreter:
user=> (to-dataset (read-json (slurp "data/small-sample.json")))
[:given_name :surname :relation]
["Gomez" "Addams" "father"]
["Morticia" "Addams" "mother"]
["Pugsley" "Addams" "brother"]
…
How it works…
Like all Lisps, Clojure is usually read from inside out, from right to left. Let's break it down.
clojure.core/slurp reads in the contents of the file and returns it as a string. This is
obviously a bad idea for very large files, but for small ones it's handy. clojure.data.json/
read-json takes the data from slurp, parses it as JSON, and returns native Clojure data
structures. In this case, it returns a vector of maps. maps.incanter.core/to-dataset
takes a sequence of maps and returns an Incanter dataset. This will use the keys in the maps as
column names and will convert the data values into a matrix. Actually, to-dataset can accept
many different data structures. Try (doc to-dataset) in the REPL interpreter or see the
Incanter documentation at http://data-sorcery.org/contents/ for more information.
Getting ready
First, make sure that our Leiningen project.clj file contains the right dependencies:
:dependencies [[org.clojure/clojure "1.4.0"]
[incanter/incanter-core "1.4.1"]
[incanter/incanter-excel "1.4.1"]]
Also, make sure that we've loaded those packages into the REPL interpreter or script:
(use 'incanter.core
'incanter.excel)
12
Random documents with unrelated
content Scribd suggests to you:
“If you can’t, I can,” responded Weeks. “I know where to put my hand
on him.”
At that moment a door at the rear of the room (within a few feet of
the table at which they were seated, in fact) opened, and a man
entered. Weeks recognized him at once as Jim Leroyd; he had seen
him before, although he could claim no speaking acquaintance with
him.
Old Arad also saw and recognized the newcomer, and as the sailor
passed along the room, he caught sight of the old farmer.
“Why, dash my top lights!” he exclaimed, in surprise. “Ef here ain’t
Mr. Tarr!”
He stepped back to the table and grasped the old man’s hand most
cordially, at the same time casting a suspicious glance at Weeks. He
knew the ex-clerk by reputation, as Weeks knew him.
“Don’t ye be up ter any funny biz with this gentleman, Sneaky,” he
said, with a scowl. “He’s my friend.”
“Don’t you fret,” responded Weeks. “He and I were talking about his
nephew, Brandon Tarr, who was up to see you yesterday——”
Mr. Leroyd uttered a volley of choice profanity at this, and Arad was
greatly surprised.
“Came ter see yeou?” he gasped. “Er—erbout that matter we was a-
talkin’ of, Mr. Leroyd? Ye know I—I’m his legal guardeen——”
“Don’t ye be scared, Mr. Tarr,” said Weeks, who understood the
circumstances pretty well, “I can vouch for Jim, here, not playing you
false.”
“What do you know about it, anyway?” growled Jim uglily.
“Now, sit down and keep cool, Leroyd,” urged Weeks. “I know all
about it. I know about your little scheme to gobble the—the treasure
aboard the Silver Swan——”
“Sh!” exclaimed Leroyd fiercely. “You know too much, young feller.”
“No, I know just enough, and I’ll prove it to you.”
“I s’pose ye think ye kin force yer way inter this, but ye’re mistaken.
This is the private affair o’ Mr. Tarr an’ me, an’ I warn ye ter keep yer
nose out.”
He arose as he spoke, his fierce eyes fixed threateningly upon
Weeks’ impassive face.
“You come with me, Mr. Tarr, where we can talk the matter over
privately. We don’t want nothin’ o’ that swab.”
The red headed ex-clerk fairly laughed aloud at this.
“See here, Leroyd,” he said, still coolly: “you made a break for those
papers yesterday, I believe. What did you get?”
“Hey?” roared the sailor.
“I said that you made a break for those papers of Cale Wetherbee’s
yesterday,” repeated Weeks, slowly and distinctly. “Now, what did
you get?”
“Not a blamed thing,” responded the sailor frankly, after an instant’s
hesitation.
“That’s what I thought. I thought Cale Wetherbee took it altogether
too coolly if you had made a haul worth anything. Now, I could tell
you something, if I thought ’twould be worth my while.”
“What is it?”
“Do you know what the treasure hidden aboard the brig consists of?”
“No,” replied Leroyd shortly, while old Arad gazed from one to the
other in bewilderment.
“Well, I do,” declared Weeks.
“Ye do?”
“Sure. I heard that Wetherbee and the boy and old man Pepper
talking it over.”
“Who’s Pepper?” growled Leroyd.
“He’s the feller who is going to back ’em in this hunt for the brig. He’s
going to furnish the vessel and all.”
“Curses on the luck!” growled the sailor again.
Here old Arad interposed. The old man’s hands were trembling
violently, and his face was pale with excitement.
“We—we must stop ’em—they ain’t got no right ter do it,” he
sputtered. “Horace Tarr was my nevvy, an’ I’m the guardeen o’ that
boy. There hain’t nobody else got no right to go arter them
di’monds.”
“Diamonds!” exclaimed Leroyd. “Is that the treasure?”
“Ye—es,” replied Arad hesitatingly, looking at Weeks. “I—I found a
letter from this Wetherbee, the mate of the Silver Swan, an’ it says
so. Horace’s brother Anson got ’em in South Afriky.”
“Good for you, old feller,” said Leroyd admiringly. “Ye did take my
advice, didn’t ye?”
Old Arad rubbed his hands together as though washing them with
imaginary soap, and grinned.
“Yes, diamonds is the treasure,” Weeks rejoined calmly. “Now, you’ll
start right off to find the brig with Mr. Tarr here to back you with
money, eh, Leroyd?”
“Never ye mind what I’ll do,” returned Jim, uglily. “I tell ye this hain’t
none o’ your funeral, so you keep out of it, Sneaky.”
“Are you sure?” asked Weeks, with a tantalizing smile.
“Yes, I’m sure!” roared the enraged sailor.
“Well, don’t holler so loud,” the red haired one admonished him. “But
I think you’re mistaken.”
Leroyd glared at him like an angry bull dog but said nothing.
“Now I s’pose,” continued Weeks, cocking his eye at the smoke
begrimmed ceiling of the bar room, “that you expect to get a vessel
an’ go in pursuit of the Silver Swan; and that when you’ve got her
you’ll tow her in port, an’ you’ll have the salvage—that’ll be a pretty
good sum.”
“And the di’monds,” interjected Arad, with an avaricious chuckle.
“Oh, will you?” said Weeks with cool sarcasm. “That remains to be
seen. You’ll have the brig fast enough: but how’ll you get the
stones?”
“Why, ef we git the brig won’t the diamonds be aboard her?” queried
Arad.
“Yes, they will; but where will they be, aboard her? Can you tell me
that?”
Arad’s jaw fell and he stared blankly at the shrewd Weeks. Even
Leroyd was visibly moved by this statement.
“You don’t know where the diamonds are hidden,” continued Weeks,
pursuing his advantage. “You might tear that whole brig to pieces an’
not find ’em, but I know just where they are and I can put my hand
right on ’em!”
“You kin?” gasped old Arad.
“Is that straight, Sneaky?” demanded Leroyd, with interest.
Weeks nodded calmly.
“I believe you’re lying,” the sailor declared.
“Well you can think so if you want to,” said the ex-clerk, rising, “and
I’ll go now and find somebody to go in with me on this scheme, and
I’ll run my chances of getting to the brig first. You can have the old
hulk and welcome after I’ve been aboard her five minutes, Leroyd.
“But, if you’ll let me in on the ground floor of this,” he continued, “and
give me one third of all there is in it, why all right. If you don’t,
probably you’ll get nothing, while me and the other fellow’ll get it all,”
and Mr. Weeks smiled benignantly upon his audience.
CHAPTER XXIV
HOW A NEFARIOUS COMPACT WAS FORMED
“But yeou can’t do that!” cried old Arad Tarr, the first to break the
silence after Mr. Weeks had delivered what might be termed his
“ultimatum.” “There hasn’t anybody got airy right ter go arter them
di’monds, but them I send.”
“That is where you make an error, Mr. Tarr,” responded Weeks
cheerfully. “This is what is called ‘treasure trove;’ the fellow who gets
there first has the best right to it.”
“It ben’t so, is it?” whined the old man, appealing to Leroyd.
“Yes, I s’pose it is,” admitted the sailor, with a growl. “He’s got us
foul, old man.”
“Now, don’t talk that way, Leroyd,” exclaimed Weeks briskly. “We
three must strike hands and share evenly in this thing. You need me,
any way, though I can get along without either of you; for you know it
wouldn’t take me long to find a man to back me with a couple of
hundred dollars against the chance of winning thousands.”
“Well, you’re right,” said the sailor, seeing that it would be for his
advantage to make terms with “Sneaky Al,” as the red haired Weeks
was familiarly called.
“Two hundred dollars is an awful lot of money ter risk,” muttered old
Arad, knowing that he was the one who would be expected to furnish
the “sinews of war.”
“’Tain’t much compared with mebbe three hundred thousand dollars.
I heered Cap’n Tarr say, myself, that there was enough o’ them
di’monds, ter make a man fabulously rich,” responded Leroyd
quickly. “That’d be a clean hundred thousand for each of us.”
“But ef I furnish the money I’d oughter hev more o’ th’ returns,”
declared the farmer, who was quite as sharp as either of his
companions.
“Come, we won’t quarrel over that,” the sailor declared, rising again.
“But we want to talk this matter over where it’s more quiet like. I’ve
got a room here. Let’s go up to it, where we shan’t be disturbed.”
“Now you’re talking sense,” Weeks declared, rising gingerly from the
chair in which he had again seated himself.
At that instant Mr. Brady, who had been kept busy at the bar by
transient customers for the past half hour, called Leroyd over to him.
“Now, look a-here, Jim,” he said, in a hoarse aside, “wot be you an’
Sneaky Al up to? Dere ain’t goin’ ter be no game played on dat
countryman here, see? Ye got me inter ’nough trouble yest’day. Ef I
hadn’t a pull in dis ward, dey’d er—nabbed me, sure.”
“Don’t you fret, Jack,” responded Leroyd reassuringly. “We ain’t inter
any bunco business. The old man knows what he’s about, ef he
does look like a hay-seed. Ef he don’t do us, it’ll be lucky.”
“Well, what’s de game?” Brady demanded.
“Never you mind, old man. We’re just going up stairs for a private
confab, an’ ef things turn out right, I kin promise a cool hundred for
keeping your mouth shut. Savey?”
Brady nodded.
“I’m mum,” he said, with satisfaction. “On’y I don’t want dem cops
down on me ag’in, so mind yer eye.”
Armed with a bottle and glasses, Leroyd led the way into a small
room a good deal nearer the roof of the building, in which the New
England Hotel was located. His two companions, however, left the
sailor to dispose of the refreshments alone; the old farmer because
he had never used liquor in any shape at home, and Weeks because
he proposed to keep his brain perfectly clear that he might be sure to
retain the “whip hand” of the other conspirators.
It is not my purpose to report verbatim the plans of the three villains.
Let it suffice to say that after much discussion, and by virtue of
coaxings, threatenings, promises, and what not, the sailor and
Weeks (who saw at once that it would be for their mutual advantage
to play into each other’s hands) obtained old Arad Tarr’s consent to
furnish them with the sum of over two hundred dollars (and more if it
was found to be actually needed) with which to charter the vessel.
You may be sure that the two rascals never worked harder (with their
tongues) for two hundred dollars in their lives, for the amount looked
as large to old Arad as ten thousand would to almost any other man.
The plot of the conspirators likewise included the discovery of
Brandon’s whereabouts and his arrest on the charge of robbery, as
set forth in the warrant with which Arad supplied himself before he
left Rhode Island. This part of the scheme Weeks proposed to attend
to.
Then, with a great deal of flourish and legal formula, the astute Mr.
Weeks drew up a most wonderful document (he was well versed in
legal phrases), which bound each of the three, Arad Tarr, James
Leroyd, and Alfred Weeks, to a co-partnership, the object of which
was to seek and obtain the floating hulk of the Silver Swan, and the
treasure thereon, the profit of the venture to be divided equally
between them, excepting the sum of one thousand dollars which was
to go to Arad Tarr under any circumstances. And, of course, the
document wasn’t worth the paper on which it was written.
But the old man didn’t know this. He was a great worshiper of the
law, and he trusted in the legality of the paper to hold his partners to
their promises. He lost sight, however, of the fact that the two men
were going together on the quest for the Silver Swan, and that he—
well, he was to stay at home, and wait. Waiting isn’t very hard work,
to be sure; but it is terribly wearing.
These several things having been accomplished, and it being long
past noon, the conspirators went their different ways—old Arad to
interview the brokerage firm of Bensell, Bensell & Marsden, which,
he was sure, was cheating him out of his dividends: Weeks to hunt
up a scaly friend of his to serve the warrant upon unsuspicious
Brandon; and Leroyd to look about for a vessel which could be
converted to their purpose in the shortest possible time.
And now, let us return to Brandon and his two good friends, Caleb
Wetherbee and Adoniram Pepper, and find out how much progress
they have made in the quest of the Silver Swan.
CHAPTER XXV
UNCLE ARAD MAKES AN ANNOUNCEMENT
The doughty deputy sheriff was on his feet in an instant, and with a
wrathy glance at Caleb, dashed out of the office after the fleeing
Brandon. If he did not make the arrest he would fail to get his money,
and he did not propose to lose that.
But Uncle Arad could not get to the door without passing Caleb and
he hardly dared do that. Just then the big seaman looked in no mood
to be tampered with. The farmer, however, did sputter out something
about having the law on everybody in general.
“Bring on all the law you want to, you old scarecrow,” responded
Caleb, vigorously mopping his face. “I reckon we kin take care of it.
What ye got there, Adoniram?”
Mr. Pepper had picked up the letter which had fallen from old Arad’s
pocket, and was looking at the superscription in a puzzled manner.
Arad caught sight of the epistle as quickly as did Caleb.
“That’s mine! give it here!” he cried, making a snatch at the paper.
But Adoniram held it out of his reach.
“I don’t see how you make that out, Mr. Tarr,” he said quietly. “This
letter is not addressed to you. It is in your handwriting, Caleb, and is
addressed to ‘Master Brandon Tarr, Chopmist, Rhode Island.’”
“Oh, you swab!” exclaimed the old tar, with a withering glance of
contempt at old Arad, as he seized the letter. “This ’ere’s what I
wrote the boy w’en I was in the hospital—w’ich same he never got.
Now, how came you by it? You old land shark!”