Clojure Data Analysis Cookbook 1st Edition Eric Rochester pdf download
Clojure Data Analysis Cookbook 1st Edition Eric Rochester pdf download
https://ebookname.com/product/clojure-data-analysis-cookbook-1st-
edition-eric-rochester/
https://ebookname.com/product/clojure-data-analysis-cookbook-2nd-
edition-eric-rochester/
https://ebookname.com/product/clojure-data-structures-and-
algorithms-cookbook-25-recipes-to-deeply-understand-and-
implement-advanced-algorithms-in-clojure-1st-edition-rafik-
naccache/
https://ebookname.com/product/haskell-data-analysis-cookbook-1st-
edition-nishant-shukla/
https://ebookname.com/product/we-are-fighting-the-world-a-
history-of-the-marashea-gangs-in-south-africa-1947-1999-1st-
edition-gary-kynoch/
Programming in Ada 2012 1st Edition Barnes
https://ebookname.com/product/programming-in-ada-2012-1st-
edition-barnes/
https://ebookname.com/product/industrial-robotics-theory-
modelling-and-control-1st-edition-edition-cubero-s-ed/
https://ebookname.com/product/barron-s-dictionary-of-legal-
terms-4th-edition-steven-h-gifis/
https://ebookname.com/product/national-trauma-and-collective-
memory-extraordinary-events-in-the-american-experience-1st-
edition-arthur-g-neal/
https://ebookname.com/product/no-child-left-behind-and-other-
federal-programs-for-urban-school-districts-volume-9-advances-in-
educational-administration-1st-edition-frank-brown/
Dialogues on Difference Studies of Diversity in the
Therapeutic Relationship 1st Edition J. Christopher
Muran
https://ebookname.com/product/dialogues-on-difference-studies-of-
diversity-in-the-therapeutic-relationship-1st-edition-j-
christopher-muran/
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
Other documents randomly have
different content
The Project Gutenberg eBook of The Golden
Bough: A Study in Comparative Religion (Vol.
2 of 2)
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
By
In Two Volumes.
Vol. II.
New York and London
1894
Contents
Chapter III—(continued).
§ 10.—The corn-spirit as an animal.
§ 11.—Eating the god.
§ 12.—Killing the divine animal.
§ 13.—Transference of evil.
§ 14.—Expulsion of evils,
§ 15.—Scapegoats.
§ 16.—Killing the god in Mexico.
Chapter IV—The Golden Bough.
§ 1.—Between heaven and earth.
§ 2.—Balder.
§ 3.—The external soul in folk-tales.
§ 4.—The external soul in folk-custom.
§ 5.—Conclusion.
Note. Offerings of first-fruits.
Index.
Footnotes
[Transcriber's Note: The above cover image was produced by the
submitter at Distributed Proofreaders, and is being placed into the
public domain.]
[pg 001]
Chapter III—(continued).
§ 10.—The corn-spirit as an animal.
So with the wolf. In Germany it is said that “The Wolf sits in the last
sheaf.”12 In some places they call out to the reaper, “Beware of the
Wolf;” or they say, “He is chasing the Wolf out of the corn.”13 The
last bunch of standing corn is called the Wolf, and the man who cuts
it “has the Wolf.” The last sheaf is also called the Wolf; and of the
woman who binds it they say, “The Wolf is biting her,” “she has the
[pg 005] Wolf,” “she must fetch the Wolf” (out of the corn).14
Moreover, she is herself called Wolf and has to bear the name for a
whole year; sometimes, according to the crop, she is called the Rye-
wolf or the Potato-wolf.15 In the island of Rügen they call out to the
woman who binds the last sheaf, “You're Wolf;” and when she
comes home she bites the lady of the house and the stewardess, for
which she receives a large piece of meat. The same woman may be
Rye-wolf, Wheat-wolf, and Oats-wolf, if she happens to bind the last
sheaf of rye, wheat, and oats.16 At Buir, in the district of Cologne, it
was formerly the custom to give to the last sheaf the shape of a
wolf. It was kept in the barn till all the corn was threshed. Then it
was brought to the farmer, and he had to sprinkle it with beer or
brandy.17 In many places the sheaf called the Wolf is made up in
human form and dressed in clothes. This indicates a confusion
between the conceptions of the corn-spirit as theriomorphic (in
animal form) and as anthropomorphic (in human form).18 Generally
the Wolf is brought home on the last waggon, with joyful cries.19
Again, the Wolf is supposed to hide himself amongst the cut corn in
the granary, until he is driven out of the last bundle by the strokes of
the flail. Hence at Wanzleben, near Magdeburg, after the threshing
the peasants go in procession, leading by a chain a man, who is
enveloped in the threshed out straw and is called the Wolf.20 He
represents the corn-spirit who has been caught escaping from the
threshed corn. In Trier it is believed that the Corn-wolf [pg 006] is
killed at threshing. The men thresh the last sheaf till it is reduced to
chopped straw. In this way they think that the Corn-wolf who was
lurking in the last sheaf, has been certainly killed.21
In France also the Corn-wolf appears at harvest. Thus they call out
to the reaper of the last corn, “You will catch the Wolf.” Near
Chambéry they form a ring round the last standing corn, and cry,
“The Wolf is in there.” In Finisterre, when the reaping draws near an
end, the harvesters cry, “There is the Wolf; we will catch him.” Each
takes a swath to reap, and he who finishes first calls out, “I've
caught the Wolf.”22 In Guyenne, when the last corn has been reaped,
they lead a wether all round the field. It is called “the Wolf of the
field.” Its horns are decked with a wreath of flowers and corn-ears,
and its neck and body are also encircled with garlands and ribbons.
All the reapers march, singing, behind it. Then it is killed on the
field. In this part of France the last sheaf is called the coujoulage,
which, in the patois, means a wether. Hence the killing of the wether
represents the death of the corn-spirit, considered as present in the
last sheaf; but two different conceptions of the corn-spirit—as a wolf
and as a wether—are mixed up together.23
Again, the corn-spirit is killed in the form of [pg 009] a cock. In parts
of Germany, Hungary, Poland, and Picardy, the reapers place a live
cock in the corn which is to be cut last, and chase it over the field,
or bury it up to the neck in the ground; afterwards they strike off its
head with a sickle or scythe.37 In many parts of Westphalia, when
the harvesters bring the wooden cock to the farmer, he gives them a
live cock, which they kill with whips or sticks, or behead with an old
sword, or throw it into the barn to the girls, or give it to the mistress
to cook. If the Harvest-cock has not been spilt—that is, if no waggon
has been upset—the harvesters have the right of killing the farmyard
cock by throwing stones at it or beheading it. Where this custom has
fallen into disuse, it is still common for the farmer's wife to make
cockie-leekie for the harvesters, and to show them the head of the
cock which has been killed for the soup.38 In the neighbourhood of
Klausenburg, Transylvania, a cock is buried on the harvest-field in
the earth, so that only its head appears. A young man then takes a
scythe and cuts off the cock's head at a single stroke. If he fails to
do this, he is called the Red Cock for a whole year, and people fear
that next year's crop will be bad.39 In the neighbourhood of
Udvarhely, Transylvania, a live cock is bound up in the last sheaf and
killed with a spit. It is then skinned. The flesh is thrown away, but
the skin and feathers are kept till next year; and in spring the grain
from the last sheaf is mixed with the feathers of the cock and
scattered on the field which is to be tilled.40 Nothing could set in a
clearer [pg 010] light the identification of the cock with the spirit of
the corn. By being tied up in the last sheaf and killed, the cock is
identified with the corn, and its death with the cutting of the corn.
By keeping its feathers till spring, then mixing them with the seed-
corn taken from the very sheaf in which the bird had been bound,
and scattering the feathers together with the seed over the field, the
identity of the bird with the corn is again emphasised, and its
quickening and fertilising power, as the corn-spirit, is intimated in the
plainest manner. Thus the corn-spirit, in the form of a cock, is killed
at harvest, but rises to fresh life and activity in spring. Again, the
equivalence of the cock to the corn is expressed, hardly less plainly,
in the custom of burying the bird in the ground, and cutting off its
head (like the ears of corn) with the scythe.
According to one view, the corn-spirit, who has been caught in the
form of a goat or otherwise, lives in the farmhouse or barn over
winter. Thus, each farm has its own embodiment of the corn-spirit.
But, according to another view, the corn-spirit is the genius or deity,
not of the corn of one farm only, but of all the corn. Hence when the
corn on one farm is all cut, he flees to another where there is still
corn left standing. This idea is brought out in a harvest-custom
which was formerly observed in Skye. The farmer who first finished
reaping sent a man or woman with a sheaf to a neighbouring farmer
who had not finished; the latter in his turn, when he had finished,
sent on the sheaf to his neighbour who was still reaping; and so the
sheaf made the round of the farms till all the corn was cut. The
sheaf was called the goabbir bhacagh, that is, the Cripple Goat.62
The corn-spirit was probably thus represented as lame because he
had been [pg 015] crippled by the cutting of the corn. We have seen
that sometimes the old woman who brings home the last sheaf must
limp on one foot.63 In the Böhmer Wald mountains, between
Bohemia and Bavaria, when two peasants are driving home their
corn together, they race against each other to see who shall get
home first. The village boys mark the loser in the race, and at night
they come and erect on the roof of his house the Oats-goat, which is
a colossal figure of a goat made of straw.64
But sometimes the corn-spirit, in the form of a goat, is believed to
be slain on the harvest-field by the sickle or scythe. Thus, in the
neighbourhood of Bernkastel, on the Moselle, the reapers determine
by lot the order in which they shall follow each other. The first is
called the fore-reaper, the last the tail-bearer. If a reaper overtakes
the man in front he reaps past him, bending round so as to leave the
slower reaper in a patch by himself. This patch is called the Goat;
and the man for whom “the Goat is cut” in this way, is laughed and
jeered at by his fellows for the rest of the day. When the tail-bearer
cuts the last ears of corn, it is said “He is cutting the Goat's neck
off.”65 In the neighbourhood of Grenoble, before the end of the
reaping, a live goat is adorned with flowers and ribbons and allowed
to run about the field. The reapers chase it and try to catch it. When
it is caught, the farmer's wife holds it fast while the farmer cuts off
its head. The goat's flesh serves to furnish the harvest supper. A
piece of the flesh is pickled and kept till the next harvest, when
another goat is killed. Then all the harvesters eat [pg 016] of the
flesh. On the same day the skin of the goat is made into a cloak,
which the farmer, who works with his men, must always wear at
harvest-time if rain or bad weather sets in. But if a reaper gets pains
in his back, the farmer gives him the goat-skin to wear.66 The reason
for this seems to be that the pains in the back, being inflicted by the
corn-spirit, can also be healed by it. Similarly we saw that
elsewhere, when a reaper is wounded at reaping, a cat, as the
representative of the corn-spirit, is made to lick the wound.67
Esthonian reapers in the island of Mon think that the man who cuts
the first ears of corn at harvest will get pains in his back,68—probably
because the corn-spirit is believed to resent especially the first
wound; and, in order to escape pains in the back, Saxon reapers in
Transylvania gird their loins with the first handful of ears which they
cut.69 Here, again, the corn-spirit is applied to for healing or
protection, but in his original vegetable form, not in the form of a
goat or a cat.
At sowing their winter corn the Prussian Slavs used to kill a goat,
consume its flesh with many superstitious ceremonies, and hang the
skin on a high pole near an oak and a large stone. Here it remained
till harvest. Then, after a prayer had been offered by a peasant who
acted as priest (Weidulut) the young folk joined hands and danced
round the oak and the pole. Afterwards they scrambled for the
bunch of corn, and the priest distributed the herbs with a sparing
hand. Then he placed the goat-skin on the large stone, sat down on
it and preached to the people about the history of their forefathers
and their old heathen customs and beliefs.78 The goat-skin thus
suspended [pg 019] on the field from sowing time to harvest
represents the corn-spirit superintending the growth of the corn.
Sometimes again the corn-spirit hides himself amongst the cut corn
in the barn to reappear in bull or cow form at threshing. Thus at
Wurmlingen in Thüringen the man who gives the last stroke at
threshing is called the Cow, or rather the Barley-cow, Oats-cow,
Peas-cow, etc., according to the crop. He is entirely enveloped in
straw; his head is surmounted by sticks in imitation of horns, and
two lads lead him by ropes to the well to drink. On the way thither
he must low like a cow, and for a long time afterwards he goes by
the name of the Cow.91 At Obermedlingen in Swabia, when the
threshing draws near an end, each man is careful to avoid giving the
last stroke. He who does give it “gets the Cow,” which is a straw
figure dressed in an old ragged petticoat, hood, and [pg 022]
stockings. It is tied on his back with a straw-rope; his face is
blackened, he is tied with straw-ropes to a wheelbarrow, and
wheeled round the village.92 Here, again, we are met with that
confusion between the anthropomorphic and theriomorphic
conception of the corn-spirit, which has been already signalised. In
Canton Schaffhausen the man who threshes the last corn is called
the Cow; in Canton Thurgau, the Corn-bull; in Canton Zurich, the
Thresher-cow. In the last-mentioned district he is wrapt in straw and
bound to one of the trees in the orchard.93 At Arad in Hungary the
man who gives the last stroke at threshing is enveloped in straw and
a cow's hide with the horns attached to it.94 At Pessnitz, in the
district of Dresden, the man who gives the last stroke with the flail is
called Bull. He must make a straw-man and set it up before a
neighbour's window.95 Here, apparently, as in so many cases, the
corn-spirit is passed on to a neighbour who has not finished
threshing. So at Herbrechtingen in Thüringen the effigy of a ragged
old woman is flung into the barn of the farmer who is last with his
threshing. The man who throws it in cries, “There is the Cow for
you.” If the threshers catch him they detain him over night and
punish him by keeping him from the harvest supper.96 In these latter
customs the confusion between the anthropomorphic and
theriomorphic conception of the corn-spirit meets us again. Further,
the corn-spirit in bull form is sometimes believed to be killed at
threshing. At Auxerre in threshing the last bundle of corn they call
out twelve times, “We are killing the Bull.” In [pg 023] the
neighbourhood of Bordeaux, where a butcher kills an ox on the field
immediately after the close of the reaping, it is said of the man who
gives the last stroke at threshing that “he has killed the Bull.”97 At
Chambéry the last sheaf is called the sheaf of the Young Ox and a
race takes place to it, in which all the reapers join. When the last
stroke is given at threshing they say that “the Ox is killed;” and
immediately thereupon a real ox is slaughtered by the reaper who
cut the last corn. The flesh of the ox is eaten by the threshers at
supper.98
“ ‘Maister A.'s, Maister A.'s, Maister A.'s!’ (naming the farmer whose
harvest is finished).
“ ‘W'eer sha't the' send 'er? w'eer sha't the' send 'er? w'eer sha't the'
send 'er?’
“ ‘To Maister B.'s, to Maister B.'s, to Maister B.'s’ (naming one whose
harvest is not finished).”
The farmer who finishes his harvest last, and who therefore cannot
send the Mare to any one else, is said “to keep her all winter.” The
mocking offer of the Mare was sometimes responded to by a
mocking acceptance of her help. Thus an old man told an inquirer,
“While we wun at supper, a mon cumm'd wi' a autar [halter] to fatch
her away.” But at one place (Longnor, near Leebotwood), down to
about 1850, the Mare used really to be sent. “The head man of the
farmer who had finished harvest first was mounted on the best
horse of the team—the leader—both horse and man being adorned
with ribbons, streamers, etc. Thus arrayed, a boy on foot led the
pair in triumph to the neighbouring farmhouses. Sometimes the man
who took the ‘mare’ received, as well as plenty of harvest-ale, some
rather rough, though good-humoured, treatment, coming back
minus his decorations, and so on.”106 In the neighbourhood of Lille
the idea of the corn-spirit [pg 026] in horse form is clearly
preserved. When a harvester grows weary at his work, it is said, “He
has the fatigue of the Horse.” The first sheaf, called the “Cross of the
Horse,” is placed on a cross of box-wood in the barn, and the
youngest horse on the farm must tread on it. The reapers dance
round the last blades of corn, crying, “See the remains of the Horse.”
The sheaf made out of these last blades is given to the youngest
horse of the parish (commune) to eat. This youngest horse of the
parish clearly represents, as Mannhardt says, the corn-spirit of the
following year, the Corn-foal, which absorbs the spirit of the old
Corn-horse by eating the last corn cut; for, as usual, the old corn-
spirit takes his final refuge in the last sheaf. The thresher of the last
sheaf is said to “beat the Horse.”107 Again, a trace of the horse-
shaped corn-spirit is reported from Berry. The harvesters there are
accustomed to take a noon-day sleep in the field. This is called
“seeing the Horse.” The leader or “King” of the harvesters gives the
signal for going to sleep. If he delays giving the signal, one of the
harvesters will begin to neigh like a horse, the rest imitate him, and
then they all go “to see the Horse.”108
Again, the corn-spirit in the form of a pig plays his part at sowing-
time as well as at harvest. At Neuautz, in Courland, when barley is
sown for the first time in the year, the farmer's wife boils the chine
of a pig along with the tail, and brings it to the sower on the field.
He eats of it, but cuts off the tail and sticks it in the field; it is
believed that the ears of corn will then grow as long as the tail.117
Here the pig is the corn-spirit, [pg 029] whose fertilising power is
sometimes supposed to lie especially in his tail.118 As a pig he is put
in the ground at sowing-time, and as a pig he reappears amongst
the ripe corn at harvest. For amongst the neighbouring Esthonians,
as we have seen,119 the last sheaf is called the Rye-boar. Somewhat
similar customs are observed in Germany. In the Salza district, near
Meiningen, a certain bone in the pig is called “the Jew on the
winnowing-fan” (der Jud' auf der Wanne). The flesh of this bone is
boiled on Shrove Tuesday, but the bone is put amongst the ashes,
which the neighbours exchange as presents on St. Peter's Day (22d
February), and then mix with the seed-corn.120 In the whole of
Hessen, Meiningen, etc., people eat pea-soup with dried pig-ribs on
Ash Wednesday or Candlemas. The ribs are then collected and hung
in the room till sowing-time, when they are inserted in the sown field
or in the seed-bag amongst the flax seed. This is thought to be an
infallible specific against earth-fleas and moles, and to cause the flax
to grow well and tall.121 In many parts of White Russia people eat a
roast lamb or sucking-pig at Easter, and then throw the bones
backwards upon the fields, to preserve the corn from hail.122
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com