100% found this document useful (1 vote)
69 views

Programming Skills for Data Science Start Writing Code to Wrangle Analyze and Visualize Data with R 1st Edition Michael Freeman - Download the ebook and start exploring right away

The document promotes the ebook 'Programming Skills for Data Science' by Michael Freeman, which teaches foundational programming skills necessary for data science using R. It covers essential topics such as data wrangling, analysis, visualization, and project management, while also emphasizing the importance of version control and collaborative work. The ebook is part of the Pearson Addison-Wesley Data and Analytics Series, aimed at providing practical knowledge for solving data-related problems.

Uploaded by

ceenatiab
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
69 views

Programming Skills for Data Science Start Writing Code to Wrangle Analyze and Visualize Data with R 1st Edition Michael Freeman - Download the ebook and start exploring right away

The document promotes the ebook 'Programming Skills for Data Science' by Michael Freeman, which teaches foundational programming skills necessary for data science using R. It covers essential topics such as data wrangling, analysis, visualization, and project management, while also emphasizing the importance of version control and collaborative work. The ebook is part of the Pearson Addison-Wesley Data and Analytics Series, aimed at providing practical knowledge for solving data-related problems.

Uploaded by

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

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Programming Skills for Data Science Start Writing


Code to Wrangle Analyze and Visualize Data with R
1st Edition Michael Freeman

https://ebookname.com/product/programming-skills-for-data-
science-start-writing-code-to-wrangle-analyze-and-visualize-
data-with-r-1st-edition-michael-freeman/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Instant data intensive apps with pandas how to


manipulate visualize and analyze your data with pandas
Hauck

https://ebookname.com/product/instant-data-intensive-apps-with-
pandas-how-to-manipulate-visualize-and-analyze-your-data-with-
pandas-hauck/

Analyzing Baseball Data with R Albert

https://ebookname.com/product/analyzing-baseball-data-with-r-
albert/

An Introduction to Spatial Data Science with GeoDa


Volume 2 Clustering Spatial Data 1st Edition Luc
Anselin

https://ebookname.com/product/an-introduction-to-spatial-data-
science-with-geoda-volume-2-clustering-spatial-data-1st-edition-
luc-anselin/

Introduction to Physical Oceanography 2nd Edition John


A. Knauss

https://ebookname.com/product/introduction-to-physical-
oceanography-2nd-edition-john-a-knauss/
Constructing Leisure Historical and Philosophical
Debates 1st Edition Karl Spracklen

https://ebookname.com/product/constructing-leisure-historical-
and-philosophical-debates-1st-edition-karl-spracklen/

MCQs in Pharmacy Practice 2nd Edition Lilian M.


Azzopardi

https://ebookname.com/product/mcqs-in-pharmacy-practice-2nd-
edition-lilian-m-azzopardi/

Paradigms of Clinical Social Work Emphasis on Diversity


Rachelle A. Dorfman-Zukerman Ph.D.

https://ebookname.com/product/paradigms-of-clinical-social-work-
emphasis-on-diversity-rachelle-a-dorfman-zukerman-ph-d/

God 1st Edition Andrew Radde-Gallwitz

https://ebookname.com/product/god-1st-edition-andrew-radde-
gallwitz/

Herpes Simplex Virus 2nd Edition Russell J. Diefenbach

https://ebookname.com/product/herpes-simplex-virus-2nd-edition-
russell-j-diefenbach/
Sins Needles A Knitorious Murder Mystery Book 7 Reagan
Davis

https://ebookname.com/product/sins-needles-a-knitorious-murder-
mystery-book-7-reagan-davis/
Programming Skills
for Data Science
The Pearson Addison-Wesley
Data and Analytics Series

Visit informit.com/awdataseries for a complete list of available publications.

T he Pearson Addison-Wesley Data and Analytics Series provides readers with


practical knowledge for solving problems and answering questions with data.
Titles in this series primarily focus on three areas:
1. Infrastructure: how to store, move, and manage data
2. Algorithms: how to mine intelligence or make predictions based on data
3. Visualizations: how to represent data and insights in a meaningful and
compelling way

The series aims to tie all three of these areas together to help the reader build
end-to-end systems for fighting spam; making recommendations; building
personalization; detecting trends, patterns, or problems; and gaining insight
from the data exhaust of systems and user interactions.

b
Make sure to connect with us!
informit.com/socialconnect
Programming Skills
for Data Science
Start Writing Code to
Wrangle, Analyze, and
Visualize Data with R

Michael Freeman
Joel Ross

Boston • Columbus • New York • San Francisco • Amsterdam • Cape Town


Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City
São Paulo • Sydney • Hong Kong • Seoul • Singapore • Taipei • Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied
warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for
incidental or consequential damages in connection with or arising out of the use of the information or
programs contained herein.

For information about buying this title in bulk quantities, or for special sales opportunities (which may include
electronic versions; custom cover designs; and content particular to your business, training goals, marketing
focus, or branding interests), please contact our corporate sales department
at corpsales@pearsoned.com or (800) 382-3419.

For government sales inquiries, please contact governmentsales@pearsoned.com.

For questions about sales outside the U.S., please contact intlcs@pearson.com.

Visit us on the Web: informit.com/aw

Library of Congress Control Number: 2018953978

Copyright © 2019 Pearson Education, Inc.

All rights reserved. This publication is protected by copyright, and permission must be obtained from the
publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by
any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding
permissions, request forms and the appropriate contacts within the Pearson Education Global Rights &
Permissions Department, please visit www.pearsoned.com/permissions/.

ISBN-13: 978-0-13-513310-1
ISBN-10: 0-13-513310-6

1 18
v

To our students who challenged us to develop better resources, and


our families who supported us in the process.

v
This page intentionally left blank
Contents
Foreword xi
Preface xiii
Acknowledgments xvii
About the Authors xix

I: Getting Started 1

1 Setting Up Your Computer 3


1.1 Setting up Command Line Tools 4
1.2 Installing git 5
1.3 Creating a GitHub Account 6
1.4 Selecting a Text Editor 6
1.5 Downloading the R Language 7
1.6 Downloading RStudio 8

2 Using the Command Line 9


2.1 Accessing the Command Line 9
2.2 Navigating the File System 11
2.3 Managing Files 15
2.4 Dealing with Errors 18
2.5 Directing Output 20
2.6 Networking Commands 20

II: Managing Projects 25

3 Version Control with git and GitHub 27


3.1 What Is git? 27
3.2 Configuration and Project Setup 30
3.3 Tracking Project Changes 32
3.4 Storing Projects on GitHub 36
3.5 Accessing Project History 40
3.6 Ignoring Files from a Project 42

4 Using Markdown for Documentation 45


4.1 Writing Markdown 45
4.2 Rendering Markdown 48
viii Contents

III: Foundational R Skills 51

5 Introduction to R 53
5.1 Programming with R 53
5.2 Running R Code 54
5.3 Including Comments 58
5.4 Defining Variables 58
5.5 Getting Help 63

6 Functions 69
6.1 What Is a Function? 69
6.2 Built-in R Functions 71
6.3 Loading Functions 73
6.4 Writing Functions 75
6.5 Using Conditional Statements 79

7 Vectors 81
7.1 What Is a Vector? 81
7.2 Vectorized Operations 83
7.3 Vector Indices 88
7.4 Vector Filtering 90
7.5 Modifying Vectors 92

8 Lists 95
8.1 What Is a List? 95
8.2 Creating Lists 96
8.3 Accessing List Elements 97
8.4 Modifying Lists 100
8.5 Applying Functions to Lists with lapply() 102

IV: Data Wrangling 105

9 Understanding Data 107


9.1 The Data Generation Process 107
9.2 Finding Data 108
9.3 Types of Data 110
9.4 Interpreting Data 112
9.5 Using Data to Answer Questions 116
Contents ix

10 Data Frames 119


10.1 What Is a Data Frame? 119
10.2 Working with Data Frames 120
10.3 Working with CSV Data 124

11 Manipulating Data with dplyr 131


11.1 A Grammar of Data Manipulation 131
11.2 Core dplyr Functions 132
11.3 Performing Sequential Operations 139
11.4 Analyzing Data Frames by Group 142
11.5 Joining Data Frames Together 144
11.6 dplyr in Action: Analyzing Flight Data 148

12 Reshaping Data with tidyr 155


12.1 What Is “Tidy” Data? 155
12.2 From Columns to Rows: gather() 157
12.3 From Rows to Columns: spread() 158
12.4 tidyr in Action: Exploring Educational Statistics 160

13 Accessing Databases 167


13.1 An Overview of Relational Databases 167
13.2 A Taste of SQL 171
13.3 Accessing a Database from R 175

14 Accessing Web APIs 181


14.1 What Is a Web API? 181
14.2 RESTful Requests 182
14.3 Accessing Web APIs from R 189
14.4 Processing JSON Data 191
14.5 APIs in Action: Finding Cuban Food in Seattle 197

V: Data Visualization 205

15 Designing Data Visualizations 207


15.1 The Purpose of Visualization 207
15.2 Selecting Visual Layouts 209
15.3 Choosing Effective Graphical Encodings 220
15.4 Expressive Data Displays 227
15.5 Enhancing Aesthetics 229
x Contents

16 Creating Visualizations with ggplot2 231


16.1 A Grammar of Graphics 231
16.2 Basic Plotting with ggplot2 232
16.3 Complex Layouts and Customization 238
16.4 Building Maps 248
16.5 ggplot2 in Action: Mapping Evictions in San Francisco 252

17 Interactive Visualization in R 257


17.1 The plotly Package 258
17.2 The rbokeh Package 261
17.3 The leaflet Package 263
17.4 Interactive Visualization in Action: Exploring Changes to the City of Seattle 266

VI: Building and Sharing Applications 273

18 Dynamic Reports with R Markdown 275


18.1 Setting Up a Report 275
18.2 Integrating Markdown and R Code 279
18.3 Rendering Data and Visualizations in Reports 281
18.4 Sharing Reports as Websites 284
18.5 R Markdown in Action: Reporting on Life Expectancy 287

19 Building Interactive Web Applications with Shiny 293


19.1 The Shiny Framework 293
19.2 Designing User Interfaces 299
19.3 Developing Application Servers 306
19.4 Publishing Shiny Apps 309
19.5 Shiny in Action: Visualizing Fatal Police Shootings 311

20 Working Collaboratively 319


20.1 Tracking Different Versions of Code with Branches 319
20.2 Developing Projects Using Feature Branches 329
20.3 Collaboration Using the Centralized Workflow 331
20.4 Collaboration Using the Forking Workflow 335

21 Moving Forward 341


21.1 Statistical Learning 341
21.2 Other Programming Languages 342
21.3 Ethical Responsibilities 343

Index 345
Foreword
The data science skill set is ever-expanding to include more and more of the analytics pipeline. In
addition to fitting statistical and machine learning models, data scientists are expected to ingest
data from different file formats, interact with APIs, work at the command line, manipulate data,
create plots, build dashboards, and track all their work in git. By combining all of these
components, data scientists can produce amazing results. In this text, Michael Freeman and Joel
Ross have created the definitive resource for new and aspiring data scientists to learn foundational
programming skills.

Michael and Joel are best known for leveraging visualization and front-end interfaces to compose
explanations of complex data science topics. In addition to their written work, they have created
interactive explanations of statistical methods, including a particularly clarifying and captivating
introduction to hierarchical modeling. It is this sensibility and deep commitment to demystifying
complicated topics that they bring to their new book, which teaches a plethora of data science
skills.

This tour of data science begins by setting up the local computing environment such as text editors,
RStudio, the command line, and git. This lays a solid foundation—that is far too often glossed
over—making it easier to learn core data skills. After this, those core skills are given attention,
including data manipulation, visualization, reporting, and an excellent explanation of APIs. They
even show how to use git collaboratively, something data scientists all too often neglect to integrate
into their projects.

Programming Skills for Data Science lives up to its name in teaching the foundational skills needed to
get started in data science. This book provides valuable insights for both beginners and those with
more experience who may be missing some key knowledge. Michael and Joel made full use of their
years of teaching experience to craft an engrossing tutorial.
—Jared Lander, series editor
This page intentionally left blank
Preface
Transforming data into actionable information requires the ability to clearly and reproducibly
wrangle, analyze, and visualize that data. These skills are the foundations of data science, a field that
has amplified our collective understanding of issues ranging from disease transmission to racial
inequities. Moreover, the ability to programmatically interact with data enables researchers and
professionals to quickly discover and communicate patterns in data that are often difficult to
detect. Understanding how to write code to work with data allows people to engage with
information in new ways and on larger scales.

The existence of free and open source software has made these tools accessible to anyone with
access to a computer. The purpose of this book is to teach people how to leverage programming to
ask questions of their data sets.

Focus of the Book


This book revolves around the practical steps needed to program for data science using the R
programming language. It takes a holistic approach to teaching the topic, recognizing that an
entire ecosystem of tools and technologies is needed to do this. While writing code is a core part of
being a data scientist (and this book), many more foundational skills must be acquired as part of
this journey. Data science requires installing and configuring software to write, execute, and
manage code; tracking the version of (and changes to) your projects; leveraging core concepts from
computer science to understand how to accomplish a given task; accessing and processing data
from a variety of sources; leveraging visual communication to expose patterns in your data; and
building applications to share insights with others. The purpose of this text is to help people
develop a strong foundation across these areas so that they can enter the data science field (or bring
data science to their field).

Who Should Read This Book


This book is written for people with no programming or data science experience, though it would
still be helpful for people active in the field. This book was originally developed to support a course
in the Informatics undergraduate degree program at the University of Washington, so it is (not
surprisingly) well suited for college students interested in entering the data science field. We also
believe that anyone whose job involves working with data can benefit from learning how to
reproducibly create analyses, visualizations, and reports.

If you are interested in pursuing a career in data science, or if you use data on a regular basis and
want to use programming techniques to gain information from that data, then this text is for you.
xiv Preface

Book Structure
The book is divided into six sections, each of which is summarized here.

Part I: Getting Started

This section walks through the steps of downloading and installing necessary software for the rest
of the book. More specifically, Chapter 1 details how to install a text editor, Bash terminal, the R
interpreter, and the RStudio program. Then, Chapter 2 describes how to use the command line for
basic file system navigation.

Part II: Managing Projects

This section walks through the technical basis of project management, including keeping track of
the version of your code and producing documentation. Chapter 3 introduces the git software to
track line-by-line code changes, as well as the corresponding popular code hosting and
collaboration service GitHub. Chapter 4 then describes how to use Markdown to produce the
well-structured and -styled documentation needed for sharing and presenting data.

Part III: Foundational R Skills

This section introduces the R programming language, the primary language used throughout the
book. In doing so, it introduces the basic syntax of the language (Chapter 5), describes
fundamental programming concepts such as functions (Chapter 6), and introduces the basic data
structures of the language: vectors (Chapter 7), and lists (Chapter 8).

Part IV: Data Wrangling

Because the most time-consuming part of data science is often loading, formatting, exploring, and
reshaping data, this section of the book provides a deep dive into the best ways to wrangle data in R.
After introducing techniques and concepts for understanding the structure of real-world data
(Chapter 9), the book presents the data structure most commonly used for managing data in R: the
data frame (Chapter 10). To better support working with this data, the book then describes
two packages for programmatically interacting with the data: dplyr (Chapter 11), and
tidyr (Chapter 12). The last two chapters of the section describe how to load data from
databases (Chapter 13) and web-based data services with application programming interfaces
(APIs) (Chapter 14).

Part V: Data Visualization

This section of the book focuses on the conceptual and technical skills necessary to design and
build visualizations as part of the data science process. It begins with an overview of data
visualization principles (Chapter 15) to guide your choices in designing visualizations. Chapter 16
then describes in granular detail how to use the ggplot2 visualization package in R. Finally,
Chapter 17 explores the use of three additional R packages for producing engaging interactive
visualizations.

Part VI: Building and Sharing Applications

As in any domain, data science insights are valuable only if they can be shared with and understood
by others. The final section of the book focuses on using two different approaches to creating
interactive platforms to share your insights (directly from your R program!). Chapter 18 uses the R
Other documents randomly have
different content
"Never take chances!" the woman warned me,
"For a boy is the thing that sticks to your heart!"
But I was mad!
I had decked mine bravely;
He was moulded a man from the very start.

THE BOLSHEVIK

I met a woman of the Ward;


She was in gay attire;
Her blouse was blue, her toes were through,
Her ear-rings flashed like fire.

A little boy with lustrous eyes


Tugged at her coloured skirt;
His skin was warm as the southern born,
And he was caked in dirt.

Two women on the sunny street—


We fell to friendly talk
Of grocers' ways, and how it pays
To purchase as you walk.

I asked her, as a neighbour might,


If she had news to tell.
She answered me, "Oh, quiet-lee,
I think we soon raise hell!

"Too much we give to grocer-men;


Too much the rich have place;
More war to-day is the only way
To put rich in hees place!
"We speak a leetle, you and I,
Some papers scatter round,
Soon rich will be, quite quiet-lee,
All trampled on the ground.

"My man, he has a job all right,


But he might have much more.
Make leetle war, and there we are:
No rich man at our door."

The dusky boy with lustrous eyes


Listened to his mamma,
And then said he, quite quiet-lee,
"Most dear, to-day I saw

"One motor car that I will own


When I am grown a man!"
His beauty spoke, in eyes, in throat,
As just sheer beauty can.

And she forgot the little war,


The beckoning blood and dirt;
She smoothed his curls, so like a girl's,
And smoothed his gay striped shirt.

"Grow up, be good, my little boy;


One motor you may run!"
Her eyes burned deep, war fell asleep
As she looked on her son.

*****

I met a woman of the Ward;


She was in gay attire;
Her blouse was blue, her toes were through,
Her ear-rings flashed like fire.
PAVLOWA DANCING

Footsteps of youth through the springtime playing,


Footfalls of snow in a blue mist straying,
The rose of Russia in a bright wind swaying—
A rose of fire and snow.

Voices chanting everywhere, but no word said,


Fairy bells from ancient towers signalling the dead,
Light love tuning viols while the dance runs red—
A flaming dance of death.

White barbaric winters and a sky star-strung,


All the hidden pathways, all the songs unsung,
Caught in flying footsteps over wild music hung—
She dances, and the Czar lies dead.

Oh, the cries, and martyrdoms, and fatal morns,


Scarlet nights and fiery wine and bitter scorns,
Dancing in a rose of joy from a field of thorns—
Rapture from a land of thorns!

CALVÉ IN BLUE

Here is blue fire


That burns mere youth away
And leaves sheer passion.
Out of the coloured flame
What pageantries arise,
As that caressing tone,
Through shimmering veils of harp and flute,
Seems to peer ghost-like down
Into a million hearts in nights long gone—
Into a million eyes!

There is a black mantilla


Of ancient Spanish lace
Over the deep blue gown.
The voice of Carmen sings again,
The mocking voice of Carmen, scarlet still
With love and certain doom.
In it there swings a sword,
And through it blows a laughing word—
That strange, and quite inevitable word
That time can never kill.

SIGN TO TRESPASSERS

Was ever a woman


Quite alone for a day?
Other women will come
Who should stay away.

Because my casement's open,


As I wait here for you,
Comes the faint Persephone
Trailing through the dew.

She has lived a thousand years,


Clasped her cosmic rose;
Why she comes to trouble me
Only heaven knows!

And there's another woman


Keeps whispering in my ear,
Till she has the whole house
Pierced through with fear.

Some wandering nun it is,


Whose lips can only pray,
Has made my house a cloister
In this dreary way.

And even now your taxi


Must be racing through the town.
(Will you love me, O my lover,
In this pale yellow gown?)

I have written out a sign


That I hope they will obey—
"For all Peering Women
There is no Right of Way."

SILVER SLIPPERS

I never wore slippers


On sweet April evenings,
But boots made for roads that we travelled in woe,
For morning and evening
Meant rough wayside places
And feet that were slow.
But now silver slippers,
Light-mannered, bright slippers,
Great mirror-like floors and a green velvet lawn,
Where we beckon with laughter,
With music, with dancing,
Sad youth—that is gone.

A FABULOUS DAY

Oh, the days of the week they are constantly seven!


And as certain to stay as the fixed stars in heaven.
But my heart that denies them will wander away
To find a more likeable, well furnished day
That I know exists somewhere, invisible, real,
And shining with moments the seven days steal.

The stocking I've wanted to darn since the spring,


The folk-song, forgotten, that calls me to sing,
The little old lady I hurry to see,
The cumbersome caller, long promised to tea,
Or the half-hidden passion pushed by through the week:
These surely may people the day that I seek.

Sometimes I shall play with a soul never born:


A companion I met on the far side of morn.
I shall nod at the losses I wept for last night,
And find my to-morrows expectant and bright.
But mostly I think the whole twenty-four hours
Will be spent in designing a new bed of flowers;
For everyone's heart, when it wanders away,
Has its own things to do on a fabulous day.
CHRISTMAS EVE

My house is arrayed
In its garlands of Christmas delight;
A red rose is this house
In its holly and soft candle light.

But my heart is as cold


As the heart of a colourless rose,
And I feel the dead weight
Of your holiday blanket of snows.

TO MARJORIE PICKTHALL

The day you died, that April yesterday,


I was alone in sunny meadow places,
When, turning a dark clump of wintry leaves,
I caught a glimpse of exquisite fresh faces,
Renewing earth.

Then, thinking of another April day


When you and I found bloom beneath the snow,
I sent you happy thoughts across the world,
Not dreaming it the day you were to go—
But yesterday.

Yet, oh, not lost! how many a year shall turn,


And youth and age, lonely for some bright way,
Shall sudden feel you on the face of earth
And push back death, and pluck you like the may—
Immortal Song!

I WHO CUT PATTERNS

I who cut patterns,


As every soul must do,
Fret myself with longing
For themes that are new.

All these fashions


Were moulded years gone by,
And, like the mask of politics,
Are coloured with a lie.

Even the treasured love motif,


This thing of you and me,
It must so carefully be cut
To keep us bound, yet free.

And death, the sombre casket


Of centuries of song,
And war, and rivalries and creeds,
These we have used too long.

To-day I found a charming thing


Of silk and golden lace,
And yet, beneath the filigree,
What an old, wrinkled face!

Still, I believe in legends


Of laughter and delight,
And words all coloured with the sun
And perfumed by the night.

And I've a mind to leave the shops


And fashions old and new,
And cut my pattern from a wind,
And baste it up with dew.

I who cut patterns,


As every soul must do,
Fret myself with longing
For themes that are new.

POETESSES

You who loved all lovely things


And wrought in jewelled lines;
You have gone your gracious ways
That are patterned in dim stones
Of perfumed, faint-hued words;
You were a thing so feminine
That even of war you sang in tender notes,
But now another one has come,
Who is herself at war.
Her songs are keen and glittering,
For she has felt the magic fire
That you did long ago;
But now the fire has burned clean through
And forged a sword of steel.
Swinging swords are women's songs
That gleam as hard as diamonds do,
And mean to cut tradition.
And yet those jewelled lines!
Strangely the ancient magic works,
Strangely the same fire lurks
And burns imprisoned there
In your dim, opaled words,
That run like paths in heaven
Paved in mosaic of sweet stones,
And make a scented highway for our feet,
Who wield these swinging swords.
GOING NORTH

GOING NORTH

White Porches

Just as we left the avenue


I saw a golden butterfly
Flutter against the windshield.
I felt the motor take the breeze,
As gaily as a yacht might do
Upon some tidal river of the seas.
We sailed a broad grey asphalt
Out past the red brick houses,
And fringy, ragged outskirts
To where the fields begin.
And Pickering, Whitby, Oshawa,
Flashed by like friendly postscripts
Of the Town's lengthy scroll,
With dusty little detours,
And cobblestone communities
To break the highway's hundred miles
Of river-like content.
We smiled at sleepy Main Streets,
And joyous village gardens,
And sprawling crimson orchards,
Heavy with ripened fruit.

Each mile or two a butterfly


Danced near the blazing windshield,
"The same gold butterfly!" we said,
"And the same village street!"

We passed a hundred porches,


Ancient and modern porches,
And some of them were white ones,
And those we loved the best.
Many a bed of phlox we passed,
Lilac and pink and white,
And they were gardens of delight
Along our asphalt river-front—
Sheer gardens of delight.
We loved all purple calicoes
On cheerful, ambling ladies,
Their morning work already done,
Sauntering through a mile of sun
Up to the general store.
Sometimes they sat on porches,
Narrow but shining porches,
Serenely shelling peas.
"Just what is life," we wondered,
"For those who sit contented
Throughout the magic summer
On these pale country porches,
Patching—knitting—talking—
Serenely shelling peas?"

II

Grey Willows
Then we turned north.
A railway train rushed by us;
The blue-bloused engineer
Hung from his stifling cab,
Waving a careless hand.
And in a moment we had lost
All thought of shining porches
And sleepy village streets.
This was a thinner world
Of smaller, leaner orchards;
Taller, barer houses;
Drier, keener air.
Here and there grey willows,
With an eerie whisper,
Bent above a narrow stream
That languidly slipped by.
And over us the noon-day sky
Turned brazen. Stark tree trunks
Showed where bush fires had run,
Charred columns of lost forests
Dried by the sun into fantastic shapes,

This narrow stream,


Unnursed by tree-held snow,
Dwarfed by the fires, fifty years ago
Would have raced by us foaming,
Even in summer, through a world of green—
A lost green world of butterflies and fern,
And soft anemones in spring;
But now at every jagged, ugly turn
Only a brush heap where the woods had been.
The very soil is scorched—
Scorched the brown ferns
Descended from the ones that long ago
Were licked into a burning wind of flame.
Poor, narrow little stream,
Bereft of that green dream
That holds the snow! ...
There was a bit of rock a mile ago,
The preface of the North!

III

Bush Road

A soft swamp road,


For forty miles through bracken and through fern,
Smooth as a snake,
With turn on twisted turn—
Turns that meant few surprises;
Yet, as it wrinkled on its way,
The softly yielding earth that overlay its granite
Seemed to say
That once the lumber trails ran here,
And once the voyageur
Sang as he paddled down the foaming stream,
And once the woodmen came,
Great gangs of woodmen
With the axe and spike,
Who set up rude encampments.
Then, to hoarse shouts and orders,
To laughter and to oaths,
To roaring fires at night and whiskey-haunted songs,
The soft green forest fell.
It died robustly as it lived,
And had its will of singing and of strife,
An ardent, powerful, various sort of life;
A more heroic fate
Than this of late—
A trail up to the playground of the North,
A bracken-haunted, snaky road,
A soft surprise to strangers, a delight.
IV

Painted Rock

Then the North took us,


Forced us through rocky walls,
Tore at our tires,
Gave us no inch of earth
Upon our steady climb.
Yet even here, beside the cruel road,
Were scraggy plots of farm,
And wood-piles neatly stacked,
And shacks, and gloomy faces.
Then an acre of more fertile land,
Pine trees and woods,
And suddenly, like a blue cup held high,
The lake Mazinawa ...
All silence, silence, silence—
Dark colours filling the blue cup.
And, like a purple stain against the sunset,
The great rock of Mazinawa,
Sacred to Indian tribes how long ago!
A thousand years ago?
Why should one care to know!

It looms up larger than I dreamed;


Roadways of rock
And canyons full of light;
Niched balconies for pines bent all one way;
Small birds in flight,
Dashing against the dark
Of that vast rocky flank,
Whose sides of iron seams,
Laid under golden lichen,
Have been a place of dreams
And of brute sacrifice.
What if it has a power to draw us near
As in the days of fear?
When from the rocklands of the Georgian Bay
Or through the bush roads whence we came to-day,
But then on foot, soft-padding all the way,
Or in the war canoes
They crowded to this small blue lake of theirs
And an old shrine ...
What are we floating towards
In this small, low canoe?
A naked, ceremonial singing past
Seems to reach out and whisper.

STUDY IN SHADOWS

The Rock at Bon Echo

Once in the twilight aisles of Amiens


I thought I knew what shadows were,
Creeping in golden dust and greying dust,
And trooping down dim flights of measured air,
Liquid in spacing, that those arches span.

II
But just last night, before the moon was up,
Our little boat stole close against these crags
That out-rear arches and reject the dark.
Yet gradually the purple of the rock
Melted before it; and again they came
Creeping in golden dust, and greying dust,
And crowding down those giant flights of stair
That open slowly as eternity,
To hold the feet of shadows, lost in night.

III

Then I remembered Götterdammerüng—


How before doom falls on the gorgeous host,
Slowly there drifts across the empty stage
A smoke-cloud, lonely as a passing soul.
In very truth the gods return to you—
Great rock that blazes colour in the sun—
And, as in the Valhalla of old song,
Parade before our eyes the whole day long
And make a glorious end,
As with you they are folded in a sleep.
No cloud foretells their doom, but wings of birds
A moment sweep your side—then fall away.

NORTHERN GRAVEYARDS

Stony fields and lonely roads,


Meagre hamlets, very lean,
And most prosperous graveyards
Lying all between.
Each few miles a graveyard,
With its crouching column
And its urns and headstones,
Very dark and solemn.

But with what an accent!


Yellow, purple, red,
Lie the votive offerings
To this public dead.

Close beside the railway,


Where the smoke drifts high,
These are decked in garlands
For the passerby.

Even in the winter,


Breaking through the snow
Immortelles beguile us,
When the train runs slow.

They are strangely cheerful,


All these plots of ground
That have lost the loneliness
Of the living. Here abound

In a comradeship increasing
Those who in their hour
Reaped a dreary harvest,
Missed a magic flower.

Over them the smoke-wreaths,


Snow, and whispering grass,
And the voice of neighbours,
Sighing as they pass;

While the urns of iron


And the barbarous vases
Chant a willing ritual
To forgotten faces.

So they sleep together,


And their shades may say:
"Wave to us, O restless traveller!
We are glad to stay."

STONY LAKE

By southern seas I have seen purple stones


Throw back the shadows of the waves and hills.
On the Ægean, so the stories run,
Greek youths, with many a saffron-coloured sail,
Rode flame-like to the rhythm of the gale.

Again, on the bright shores of this small lake,


Purple of hills and pink of northern rocks.
To-day I met a sail-boat in the wind
And at its mast a brown Canadian boy—
He was as splendid as his mate of Troy.

TRADE

It might have been two hundred years ago,


For all the difference in her way or mine,
That her canoe, with paddle dipping slow,
Just as the sunset ran to embers low,
Stopped at my rocky door.

With fish and basketwork she plied her trade,


And I, to help a little money last,
Answered her barter with a coat I made
Of coloured wool—oh, many seasons past!
We were both satisfied!

SNAKE ISLAND

"Ages ago," my Indian says


(As we are fishing in a cove
Of this green island, with its trees and shacks),
"Here was wild grass and many snakes.
After a while they disappear,
For soon the white man comes, and makes
Houses like these to live in!"

So the old name is suddenly made new.


Snake Island! ...

Ages ago, perhaps, the trees were elfin


And tall grass towered to the skies,
Until, to all those narrow, screen-like eyes,
This was a dazzling fen,
Perplexed with tangled fern,
Peopled with glittering prey;
Dense borderland to where the black pools lay
Whose captives twist and turn.

Burrowing, boa-like, harlequin snakes,


Your day was brilliant and flashing enough!
Snakes casting skins in continuous slough,
Grass snakes and ring snakes, on dragon-flies bent.
Was there a charmer, with musical pipe,
Lured you a moment? Some Indian charm
Surely touched you with sorcery, gave you alarm,
Ere the people who meant to build houses like these
Came and killed you—
And killed the wild grass.

JUNIPER RING

Juniper ring on the granite rock,


Deep and green and perfectly planned;
Living with you I understand
Circle-magic of old.

You had a sister in mystery—


Was it only an April ago
That a crocus cup on a bed of snow
Promised eternal things?

It will be longer, Juniper,


Till earth declares you ready to break,
And you fade of the havoc her brown hands make
That are covered with mystic rings.

WHITE SLUMBER
Who has come to that farthest island
Beyond White Gull Bay?
There is a little tent among the birches
Since yesterday.
Those birches are the palest things
Even in the morning sun!
Among them the tent has suddenly blossomed,
As the white flower of a night-blooming cereus,
Silently, deep in some forest of sleep,
Might have done.
Who are they? What dreams must be theirs,
Who have found such a magical camp unawares?

CRIMSON POOL

Even you, dark pool—


Even you feel death.
On your soft brown surface
There are deep reflections
Of a fiery breath.
To the waiting forest
Death does not come creeping
As it comes to men;
It comes shouting, waving banners,
Burning out its way with torches,
Hanging garlands now and then.
All the green walls of your silence
Hung with crimson,
Even you, dark pool—
Even you feel death.
On your soft brown surface
There are deep reflections
Of a fiery breath.
MIRACLES

MIRACLES

We said: "The Universe shall kneel!"


And so the dreams of long ago
Have bound the winds and stars,
And lashed the waves to giant bars,
Till Light itself is chained.
We fly on wings of steel;
We beckon Mars.
Almost the frightened worlds, I feel,
Must in their journeys swerve and wheel
Far from the Will of Earth.

Suppose the Universe should speak!


And on some thundering street
Quite suddenly, before our eyes
A fountain, cool and sweet,
A careless, laughing little thing
Should dance upon the air
And all the very wise of us
Be held in wonder there! ...
Suppose one day an angel,
Through some caprice or whim,
Should walk along a city way
That we might talk to him;
And all the men and women,
And all the horses too,
Should bow and fall before him,
As mortals used to do! ...
I wish that some quaint miracle
Might happen, even to-day,
Whereby the Universe should speak
And men kneel down to pray.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like