100% found this document useful (5 votes)
23 views

SAS for R users : a book for budding data scientists First Edition Ohri All Chapters Instant Download

book

Uploaded by

vrbatorlas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
23 views

SAS for R users : a book for budding data scientists First Edition Ohri All Chapters Instant Download

book

Uploaded by

vrbatorlas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

Download Full Version ebookmass - Visit ebookmass.

com

SAS for R users : a book for budding data


scientists First Edition Ohri

https://ebookmass.com/product/sas-for-r-users-a-book-for-
budding-data-scientists-first-edition-ohri/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmass.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Applied Data Analysis and Modeling for Energy Engineers


and Scientists

https://ebookmass.com/product/applied-data-analysis-and-modeling-for-
energy-engineers-and-scientists/

ebookmass.com

Statistical Modeling With R: A Dual Frequentist and


Bayesian Approach for Life Scientists Pablo Inchausti

https://ebookmass.com/product/statistical-modeling-with-r-a-dual-
frequentist-and-bayesian-approach-for-life-scientists-pablo-inchausti/

ebookmass.com

Data Analysis for the Life Sciences with R 1st Edition

https://ebookmass.com/product/data-analysis-for-the-life-sciences-
with-r-1st-edition/

ebookmass.com

The Pearson Question Bank for Electronics & Communication


Engineers (PSUs/GATE/IES) Satish K. Karna

https://ebookmass.com/product/the-pearson-question-bank-for-
electronics-communication-engineers-psus-gate-ies-satish-k-karna/

ebookmass.com
Women and the Crusades Helen J. Nicholson

https://ebookmass.com/product/women-and-the-crusades-helen-j-
nicholson/

ebookmass.com

Python Programming: Using Problem Solving Approach 1st


Edition Reema Thareja

https://ebookmass.com/product/python-programming-using-problem-
solving-approach-1st-edition-reema-thareja/

ebookmass.com

Sustainability Analytics Toolkit for Practitioners:


Creating Value in the 21st Century 1st Edition Renard Siew

https://ebookmass.com/product/sustainability-analytics-toolkit-for-
practitioners-creating-value-in-the-21st-century-1st-edition-renard-
siew/
ebookmass.com

Specialty Imaging: Arthrography 2nd Edition Julia Crim Md

https://ebookmass.com/product/specialty-imaging-arthrography-2nd-
edition-julia-crim-md/

ebookmass.com

Practical wellbore hydraulics and hole cleaning unlock


faster, more efficient, and trouble-free drilling
operations Mark S. Ramsey
https://ebookmass.com/product/practical-wellbore-hydraulics-and-hole-
cleaning-unlock-faster-more-efficient-and-trouble-free-drilling-
operations-mark-s-ramsey/
ebookmass.com
The guide to interpersonal psychotherapy Klerman

https://ebookmass.com/product/the-guide-to-interpersonal-
psychotherapy-klerman/

ebookmass.com
SAS for R Users
SAS for R Users

A Book for Data Scientists

Ajay Ohri

Delhi, IN
This edition first published 2020
© 2020 John Wiley & Sons, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,
or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording
or otherwise, except as permitted by law. Advice on how to obtain permission to reuse material
from this title is available at http://www.wiley.com/go/permissions.

The right of Ajay Ohri to be identified as the author of this work has been asserted in accordance
with law.

Registered Office
John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, USA

Editorial Office
111 River Street, Hoboken, NJ 07030, USA

For details of our global editorial offices, customer services, and more information about Wiley
products visit us at www.wiley.com.

Wiley also publishes its books in a variety of electronic formats and by print‐on‐demand. Some
content that appears in standard print versions of this book may not be available in other formats.

Limit of Liability/Disclaimer of Warranty


While the publisher and authors have used their best efforts in preparing this work, they make no
representations or warranties with respect to the accuracy or completeness of the contents of this
work and specifically disclaim all warranties, including without limitation any implied warranties
of merchantability or fitness for a particular purpose. No warranty may be created or extended
by sales representatives, written sales materials or promotional statements for this work. The
fact that an organization, website, or product is referred to in this work as a citation and/or
potential source of further information does not mean that the publisher and authors endorse the
information or services the organization, website, or product may provide or recommendations
it may make. This work is sold with the understanding that the publisher is not engaged in
rendering professional services. The advice and strategies contained herein may not be suitable
for your situation. You should consult with a specialist where appropriate. Further, readers should
be aware that websites listed in this work may have changed or disappeared between when this
work was written and when it is read. Neither the publisher nor authors shall be liable for any
loss of profit or any other commercial damages, including but not limited to special, incidental,
consequential, or other damages.

Library of Congress Cataloging‐in‐Publication Data


Names: Ohri, (Ajay), author.
Title: SAS for R users : a book for data scientists / Ajay Ohri.
Description: First edition. | Hoboken, NJ : John Wiley & Sons, Inc., 2020.
| Includes bibliographical references and index.
Identifiers: LCCN 2019021408 (print) | ISBN 9781119256410 (pbk.)
Subjects: LCSH: SAS (Computer program language) | R (Computer program
language) | Statistics–Data processing.
Classification: LCC QA76.73.S27 O44 2020 (print) | LCC QA76.73.S27
(ebook) | DDC 005.5/5–dc23
LC record available at https://lccn.loc.gov/2019021408
LC ebook record available at https://lccn.loc.gov/2019980765

Cover Design: Wiley


Cover Image: © DmitriyRazinkov/Shutterstock

Set in 10/12pt Warnock by SPi Global, Pondicherry, India

Printed in the United States of America

10 9 8 7 6 5 4 3 2 1
This book is dedicated to my students and my family, my son Kush Ohri,
members of my church, and my God Jesus Christ.
vii

Contents

Preface xiii
Scope xiv

1 About SAS and R 1


1.1 ­About SAS 1
1.1.1 Installation 2
1.2 ­About R 2
1.2.1 The R Environment 3
1.2.2 Installation of R 3
1.3 ­Notable Points in SAS and R Languages 4
1.4 ­Some Important Functions with Comparative Comparisons
Respectively 4
1.5 ­Summary 5
1.6 Quiz Questions 5
Quiz Answers 6

2 Data Input, Import and Print 7


2.1 ­Importing Data 7
2.1.1 Packages in R 7
2.2 ­Importing Data in SAS 8
2.2.1 Data Input in SAS 8
2.2.2 Using Proc Import to Import a Raw File 10
2.2.3 Creating a temporary dataset from a permanent
one using “set” 10
2.3 ­Importing Data in R 10
2.3.1 Importing from Comma Separated Value (CSV) Files 11
2.3.2 Importing from Excel Files 11
2.3.3 Importing from SAS 12
2.3.4 Importing from SPSS and STATA 12
2.3.5 Assigning the Values Imported to a Data Object in R 12
viii Contents

2.4 ­Providing Data Input 13


2.4.1 Data Input in R 13
2.4.1.1 Using the c() function is the simplest way to create
a list in R 13
2.4.1.2 Providing missing values to the vector 13
2.4.1.3 To Input multiple columns of data 14
2.4.1.4 Using loops to input 14
2.5 ­Data Input in SAS 14
2.6 ­Printing Data 16
2.6.1 Print in SAS 16
2.6.2 Print in R 16
2.7 ­Summary 17
2.8 Quiz Questions 17
Quiz Answers 18

3 Data Inspection and Cleaning 19


3.1 ­Introduction 19
3.2 ­Data Inspection 19
3.2.1 Data Inspection in SAS 19
3.2.2 Data Inspection in R 20
3.3 ­Missing Values 22
3.3.1 Missing Values in SAS 22
3.3.2 Missing Values in R 26
3.4 ­Data Cleaning 29
3.4.1 Data Cleaning in SAS 29
3.4.2 Data Cleaning in R 31
3.5 Quiz Questions 31
Quiz Answers 32

4 Handling Dates, Strings, Numbers 33


4.1 ­Working with Numeric Data 33
4.1.1 Handling Numbers in SAS 33
4.1.2 Numeric Data in R 35
4.2 ­Working with Date Data 37
4.2.1 Handling Dates in SAS 37
4.2.2 Handling Dates in R 39
4.3 ­Handling Strings Data 42
4.3.1 Handling Strings Data in SAS 42
4.3.2 Handling Strings Data in R 46
4.4 Quiz Questions 48
Quiz Answers 49
Contents ix

5 Numerical Summary and Groupby Analysis 51


5.1 ­Numerical Summary and Groupby Analysis 51
5.2 ­Numerical Summary and Groupby Analysis in SAS 51
5.3 ­Numerical Summary and Group by Analysis in R 58
5.3.1 Hmisc and Data.Table Packages 60
5.3.2 Dplyr Package 63
5.4 Quiz Questions 71
Quiz Answers 72

6 Frequency Distributions and Cross Tabulations 75


6.1 ­Frequency Distributions in SAS 75
6.2 ­Frequency Distributions in R 78
6.2.1 Frequency Tabulations in R 78
6.2.2 Frequency Tabulations in R with Other Variables Statistics 81
6.3 Quiz Questions 82
Quiz Answers 82

7 Using SQL with SAS and R 85


7.1 ­What is SQL? 85
7.1.1 Basic Terminology 85
7.1.2 CAP Theorem 85
7.1.3 SQL in SAS and R 86
7.2 ­SQL Select 86
7.2.1 SQL WHERE 89
7.2.2 SQL Order By 89
7.2.3 AND, OR, NOT in SQL 90
7.2.4 SQL Select Distinct 93
7.2.5 SQL INSERT INTO 94
7.2.6 SQL Delete 96
7.2.7 SQL Aggregate Functions 97
7.2.8 SQL ALIASES 98
7.2.9 SQL ALTER TABLE 99
7.2.10 SQL UPDATE 100
7.2.11 SQL IS NULL 102
7.2.12 SQL LIKE and BETWEEN 103
7.2.13 SQL GROUP BY 104
7.2.14 SQL HAVING 105
7.2.15 SQL CREATE TABLE and SQL CONSTRAINTS 106
7.2.16 SQL UNION 108
7.2.17 SQL JOINS 110
7.3 ­Merges 112
x Contents

7.4 ­Summary 117


7.5 Quiz Questions 117
Quiz Answers 118

8 Functions, Loops, Arrays, Macros 119


8.1 ­Functions 119
8.2 ­Loops 119
8.3 ­Arrays 121
8.4 ­Macros 122
8.5 Quiz Questions 126
Quiz Answers 127

9 Data Visualization 129


9.1 ­Importance of Data Visualization 129
9.2 ­Data Visualization in SAS 130
9.3 ­Data Visualization in R 143
9.4 Quiz Questions 148
Quiz Answers 149

10 Data Output 151


10.1 ­Data Output in SAS 151
10.2 ­Data Output in R 153
10.3 Quiz Questions 156
Quiz Answers 157

11 Statistics for Data Scientists 159


11.1 ­Types of Variables 159
11.2 ­Statistical Methods for Data Analysis 160
11.3 ­Distributions 160
11.4 ­Descriptive Statistics 161
11.4.1 Measures of Central Tendency: It is the Measure of Location that
Gives an Overall Idea of the Dataset 161
11.4.2 Measures of Dispersion 161
11.4.3 Skewness and Kurtosis 162
11.4.4 Central Limit Theorem 162
11.5 ­Inferential Statistics 162
11.5.1 Hypothesis Testing 163
11.5.2 Probability 165
11.5.3 Bayes Theorem 166
11.6 ­Algorithms in Data Science 166
11.6.1 Cross Validation 167
11.6.2 Types of Regression 167
Contents xi

11.6.3 Metrics to Evaluate Regression 168


11.6.4 Types of Classification 169
11.6.5 Metrics to Evaluate Classification 171
11.6.6 Types of Clustering 174
11.6.7 Types of Time Series Analysis 177
11.6.8 Types of Dimensionality Reduction 180
11.6.9 Types of Text Mining 180
11.7 Quiz Questions 181
Quiz Answers 181

Further Reading 183


Index 185
xiii

Preface

I would like to thank the generosity of the SAS Institute and its employees
to provide SAS On Demand for Academics for free without whom this book
would not exist. In addition, I also want to thank the baristas from Starbucks
Gurgaon. These are the people who downvote my questions on Stackoverflow.
You inspire me guys.
SAS for R users is aimed at entry‐level data scientists. It is not aimed at
researchers in academia nor is it aimed at high‐ end data scientists working on
Big Data, deep learning, or machine learning. In short, it is merely aimed at
human learning business analytics (or data science as it is now called).
Both SAS and R are widely used languages and yet both are very different.
SAS is a programming language that was designed in the 1960s which is broadly
divided into Data Steps and a wide variety of Procedure or PROC steps, while
R is an object oriented, mostly functional, language designed in the 1990s.
There are many, many books covering either but only very few books
­covering both.
Why then write the book? After all, I have written two books on R, and one
on Python for R. SAS language remains the most widely used language in
enterprises, contributing directly to the brand name, and profitability of one
of the largest private software companies that invests hugely in its own research
instead of borrowing research in the name of open source. A statistics student
knowing Python (esp Machine Learning ML), R, SAS, Big Data (esp Spark ML),
Data Visualization (using Tableau) is a mythical unicorn unavailable to
­recruiters who often have to settle for a few of these skills and then train them
in house.
As a teacher, I want my students to have jobs – there is no ideological tilt to
open source or any company here. The probability of students getting jobs
from campus greatly increases if they know BOTH SAS and R not just one of
them. That is why this book has been written.
xiv

Scope

This book is designed for professionals and students; people who want to enter
data science and who have a coding background with some basics of statistical
information. It is not aimed at researchers or people who like giraffes and do
not read the book from the beginning.
1

About SAS and R

Here is a brief introduction about R and SAS,instructions about installations


and a broad high‐level comparison.

1.1 ­About SAS
SAS used to be called the Statistical Analysis System Software suite developed
by the SAS Institute for advanced analytics, business intelligence, data man-
agement, and predictive analytics. Developed at North Carolina State
University from 1966 until 1976, when the SAS Institute was incorporated. It
was then further developed in the 1980s and 1990s with the additional statisti-
cal procedures and components. SAS is a language, a software suite and a com-
pany created by Anthony James Barr and James Goodnight along with two
others. For purposes of this book we will use SAS for SAS computer language.
●● SAS also provides a graphical point and click user interface for non‐technical
users.
While a graduate student in statistics at North Carolina State University,
James Goodnight wrote a computer program for analyzing agricultural data.
After a few years, James’s application had attracted a diverse and loyal
­following among its users, and the program’s data management and reporting
capabilities had expanded beyond James’s original intentions.
In 1976, he decided to work at developing and marketing his product on a
full‐time basis, and the SAS Institute was founded. Since its beginning, a dis-
tinguishing feature of the company has been its attentiveness to users of the
software. Today, the SAS Institute is the world’s largest privately‐held software
company, and Dr. James Goodnight is its CEO. He continues to be actively
involved as a developer of SAS System software as well as being one of the most
widely respected CEOs in the community.

SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
2 SAS for R Users

The SAS System has more than 200 components


●● Base SAS – Basic procedures and data management
●● SAS/STAT – Statistical analysis
●● SAS/GRAPH – Graphics and presentation
●● SAS/OR – Operations research
●● SAS/ETS – Econometrics and Time Series Analysis
●● SAS/IML – Interactive matrix language
The SAS University Edition includes the SAS products Base SAS®, SAS/
STAT®, SAS/IML®, SAS/ACCESS® Interface to PC Files, and SAS Studio. SAS
has an annual license fee and almost 98% return to SAS every year, voting by
their chequebook. All these products are Copyright © SAS Institute Inc., SAS
Campus Drive, Cary, North Carolina 27513, USA. (https://decisionstats.
com/2009/08/20/the‐top‐decisionstats‐articles‐part‐1‐analytics/and https://
en.wikipedia.org/wiki/SAS_(software))

1.1.1 Installation
While SAS Software for Enterprises is priced at an annual license, for students,
researchers and learners you can choose from the SAS University Edition
(a virtual machine) at https://www.sas.com/en_in/software/university‐edition.
html or SAS on Demand at https://odamid.oda.sas.com/SASLogon/login
(a software as a service running SAS in browser).
To install the SAS University Edition on your Virtual machine you can follow
the following steps (I am using VMware Workstation for this):
●● Run your Virtual Machine and click on file.
●● Open and select SAS University Edition (the extension of the file should
be .ova). You can provide a new name and storage path for your new Virtual
Machine and then import.
●● Now, you need to initially run the virtual machine and use the link provided
in the VM to connect to the SAS University Edition in your browser.

1.2 ­About R
R is a language and environment for statistical computing and graphics. It is
a GNU project which is similar to the S language and environment which was
developed at Bell Laboratories (formerly AT&T, now Lucent Technologies)
by John Chambers and colleagues. R can be considered as a different imple-
mentation of S. R was initially written by Robert Gentleman and Ross Ihaka.
About SAS and R 3

1.2.1 The R Environment


From https://www.r‐project.org/about.html, R is an integrated suite of soft-
ware facilities for data manipulation, calculation and graphical display. It
includes:
●● an effective data handling and storage facility,
●● a suite of operators for calculations on arrays, in particular matrices,
●● a large, coherent, integrated collection of intermediate tools for data
analysis,
●● graphical facilities for data analysis and display either on‐screen or on hard-
copy, and
●● a well‐developed, simple and effective programming language which includes
conditionals, loops, user‐defined recursive functions and input and output
facilities.
There are almost 14 000+ packages in R (https://www.rdocumentation.org).
You can also look at specific views of packages (https://cran.r‐project.org/web/
views is a task view like a bundle or cluster of packages with similar usage i.e.
econometrics). For computationally‐intensive tasks, C, C++ and Fortran code
can be linked and called at run time. Advanced users can write C code to
manipulate R objects directly.

1.2.2 Installation of R
You can download and install R from https://www.r‐project.org (or specifically
from https://cloud.r‐project.org for your operating system). You can then
download and install the IDE RStudio from https://www.rstudio.com/
products/rstudio/download/#download. Lastly, you can install any of 12 000+
packages (see https://cran.r‐project.org/web/views and https://www.
rdocumentation.org) using install.packages(“PACKAGENAME”) from
within R. These packages can be downloaded from the CRAN (Comprehensive
R Archive Network).
Within https://www.datacamp.com/community/tutorials/r‐packages‐guide,
R packages are collections of functions and datasets developed by the com-
munity. They increase the power of R either by improving existing base
R functionalities, or by adding new ones. For example, you can use sqldf
package to use SQL with R and RODBC package to connect to RDBMS
databases.
In addition, an excellent resource is how to learn SAS for R users from
the SAS Institute itself.
https://support.sas.com/edu/schedules.html?ctry=us&crs=SP4R
4 SAS for R Users

The e‐learning course is free as of October 2018. The course teaches


the following:
●● how to read and write SAS programs
●● import various forms of data
●● subset and merge data tables including using SQL (by the Proc SQL procedure)
●● carry out iterative processing and simulate new data
●● create new variables and functions
●● create and enhance plots of all types
●● apply descriptive and inferential procedures, including regression, logistic
regression, analysis of variance, stepwise model selection, and mixed models
●● conduct matrix algebra and statistical simulations in the interactive matrix
language (IML)
●● call R from SAS to use as a complimentary resource.

1.3 ­Notable Points in SAS and R Languages


1) Each line in SAS ends with; R does not have any such limitation
2) SAS is case insensitive – ozone and OZone are the same thing. R is case
sensitive.
3) In SAS comments are within /* */ (press Ctrl + /). In R comments follow #
4) SAS has two kinds of statements:
a) Data Step which deals with input, manipulation of data and

data ajay;
set input;
run;

b) Proc Step which are procedural steps for analysis and output.

proc contents data = ajay;


run;

R has functions and packages for similar functions bundled together


5) SAS needs a license for extra functionality (e.g., for Time Series you needed SAS
/ETS license) while R is free and extensible (forecast package for Time Series).

1.4 ­Some Important Functions with Comparative


Comparisons Respectively
A Proc by Proc comparison in SAS language with R language functions is
shown below. It will be explained in greater detail in later chapters. Some peo-
ple consider R’s smaller syntax helpful in coding while others consider SAS to
be easier to learn and focus on analysis instead.
About SAS and R 5

Function SAS R
Import data proc import read_csv (readr package)
Print data proc print ajay
data=ajay;
run;
Structure proc contents str(ajay)
of Data data=ajay;
Object run;
Frequency of proc freq data= table(ajay$var1,ajay$var2)
Categorical ajay;
Variables tables var1*var2;
(Cross run;
Tabulation)
Analysis of Proc means summary(ajay$var1,ajay$var2)
Numerical Proc means data=
Variables ajay; library(Hmisc)
without/ Var var1 var2; summarize(ajay$var1,ajay$grp
with Run; 1,summary)
grouped by
another Proc means summarize(ajay$var1,ajay$grp
variable daya=ajay; 1,summary)
Var var1 var2;
Class grp1;
run;

1.5 ­Summary
In this chapter we have introduced R and SAS languages, and briefly compared
their main functions/syntax.

1.6 Quiz Questions


1 Who is the CEO of SAS?

2 When was SAS founded?

3 Where was SAS founded?

4 Who designed R?

5 When was R founded?

6 Where was R founded?


6 SAS for R Users

7 Which of the two languages has a better documentation and customer


support?

8 TASK: Suppose you know SQL. Can you identify functions or packages you
can use in SAS and R respectively to run SQL commands?

Quiz Answers
1 JAMES GOODNIGHT

2 1976

3 NORTH CAROLINA STATE UNIVERSITY

4 ROSS IHAKA AND ROBERT GENTLEMAN

5 1993

6 UNIVERSITY OF AUCKLAND

7 SAS

8 IN SAS: use proc. sql, IN R: use sqldf package.


7

Data Input, Import and Print

2.1 ­Importing Data
Importing data is the first step in analyzing data. It is important that you
have reliable and relevant data. You should be able to import data correctly
because the computer processes what data you input. If the imported data is
faulty, the analysis that you will receive after performing various tasks on it will
also be erroneous and misleading.
This concept is also commonly known as GIGO (Garbage In Garbage OUT).
Therefore, the input step is one of the most important steps in the data science
pipeline. There could also be different ways to input data in R and SAS from
files or from data connections. Importing of datasets calls for certain functions
in R whereas it calls for certain procedures for the same in SAS.

2.1.1 Packages in R
Importing of data in R can be done using certain packages and functions, and
to use those packages, we need to install them in our application.
Installing a package has the following command in R:

install.packages(“package_name”)

After installation to use this package you must load that package. Loading
a package means getting the package in active state (session). To load a
package use:

library(“package_name”)

SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
8 SAS for R Users

Updating a package:

update.packages(“package_name”)

Note that we install the package only once, we update it occasionally and we
load it every time we begin a R session. To unload a package, we use:

detach.packages(“package_name”)

To uninstall a package we use:

uninstall.packages(“package_name”)

2.2 ­Importing Data in SAS


Here we study multiple ways to input data.
In SAS to save space you can put this in the beginning options
compress = yes;

2.2.1 Data Input in SAS


Data Input in SAS manually has been an easy task, and there are a certain set
of examples where you can easily learn how to input data in SAS.
The INPUT statement reads raw data from instream data lines or external
files into a SAS dataset. Data input is the first step for every analysis, without
any dataset or data there can be no analysis of any kind. Data input can be done
in various forms. Let’s look at a few examples of data input in SAS.
In the examples given below, we have input normal numerical data, strings,
names etc.

data first;
infile datalines
input m n;
datalines;
5 10
10 20
20 40
;
run;
Data Input, Import and Print 9

The code above creates a dataset named first.


●● infile statement is used to specify the type of data to be read.
●● input statement is used to specify the names, number and type of variables
being read.
●● datalines statement is used to specify that the following lines contain the
data to be read.
●● The keyword “cards” can also be used instead of “datalines.”

data second;
infile datalines
input name$ points;
datalines;
ajay 10
kush 9
;
run;

data third;
infile datalines missover dsd;
input m n o;
,2,3
4,,6
7,8,9

●● $ sign is used to specify that the variable it follows is a character variable


●● Missover option is used to prevent the data step from going to the next line
if it does not find values for all variables in the input statement in the current
record.
●● dsd option is used to treat commas as separator characters.
Code to import in SAS is different from R because in R we use functions
whereas in SAS we generally call procedures. R is an object‐oriented
language.
Using the Import Wizard is an easy and straightforward way to import exist-
ing data with well‐behaved formatting into SAS. There are other methods for
importing data into SAS like proc. import, or even entering raw observations
into SAS itself to create a new dataset.
These methods of importing or creating data can give you greater control
over how to read variables (the informats), how to write the variables
(the formats), how to parse the data (delimited, aligned, repetition, etc.),
and more.
10 SAS for R Users

2.2.2 Using Proc Import to Import a Raw File

proc import out=dataset_name


DBMS= file_type
datafile= ‘file_path’;
getnames=yes;
run;

Here we use the proc. import step to import a raw data file and save it as an
SAS dataset. DBMS is used to specify the file type, e.g.: CSV, XLS etc.
getnames = yes is to specify that the first row contains column names.
Note: The type of dataset created (temporary or permanent) depends on the
name you specify in the out = statement.
A permanent dataset has to be referenced by a two‐level name: ‐ library_
name.data_set_name whereas a temporary dataset just has a one‐level
name.

2.2.3 Creating a temporary dataset from a permanent


one using “set”

data temp_setname;
set libname.permaset_name;
run;

2.3 ­Importing Data in R
There are a number of ways to import data into R, and several formats are
available:
1) From CSV files using readr or data. Table package
2) From Excel to R
3) From SAS to R
4) From SPSS to R
5) From Stata to R, and more
6) From Relational Databases (RDBMS) using RODBC
7) From json files using jsonlite package
https://rforanalytics.wordpress.com/useful‐links‐for‐r/odbc‐databases‐for‐r
Let us explore some of the ways to import data in R.
Data Input, Import and Print 11

2.3.1 Importing from Comma Separated Value (CSV) Files


There are three functions which can be used to import csv files in R:
1) read.csv() or read. Table() which are in the utils package which is installed
and loaded by default.

read.csv("file_path.csv") or read.table("file_path.csv")

2) read_csv which is in the readr package.


install.packages("readr")
library("readr")

read_csv("file_path.csv")

3) fread() which is in the data. Table package.


install.packages("data.table")
library("data.table")

fread("file_path.csv")

fread and read_csv are the fastest of all these.

You can use the system. Time() function to verify that as follows:

system.time(read.csv("file_path.csv"))
system.time(read_csv("file_path.csv"))

system.time(fread("file_path.csv"))

2.3.2 Importing from Excel Files


We need to install readxl package and use the read_excel function to import
.xls or .xlsx types of files.

install.packages("readxl")
library("readxl")

read_excel("file_path.xls")
12 SAS for R Users

Example: To import sheet 1 of an excel file with the first row as column
names

read_excel("MySpreadSheet.xls", sheet=1, col_names=TRUE)

We can also use sheet names put within double quotes instead of the sheet
number to specify the sheet we want from any excel file.

2.3.3 Importing from SAS


read.sas7bdat() from sas7bdat package is used to import .sas7bdat
files

install.packages("sas7bdat")
library("sas7bdat")
read.sas7bdat("file_path.sas7bdat")

2.3.4 Importing from SPSS and STATA


We use the read.spss () and read.dta() function from foreign package to import
SPSS and STATA files respectively.

install.packages("foreign")
library("foreign")
read.spss("file_path.spss")
read.dta("file_path.dta")

2.3.5 Assigning the Values Imported to a Data Object in R


Assigning in R has the following syntax:

objectname=value;
or
objectname <‐ value;

The following code is used to assign the imported file to an object.

objectname=read_csv("file_path",parameters)
Data Input, Import and Print 13

Similarly, data read using other functions can be assigned to R objects.


Note: Each of the functions used to import data discussed above take in
more parameters which define certain formatting to be done on the data while
importing.
To manually input we use the following

> ajay=c(11,2,30)
> ajay
[1] 11 2 30

We can do the same for other types of data except string variables which will
be in quotes (i.e. “ten”)

2.4 ­Providing Data Input


We can also create datasets, vectors or matrices by using the input value given
by us.

2.4.1 Data Input in R


2.4.1.1 Using the c() function is the simplest way to create a list in R
We can input numerical, dates and string values as follows:

ajay=c(10,20,30,40)
dates2=c("26jun98","1/09/2005","1January2016")
newone=c("Raj","Shiva","Kamal","Ajay")

2.4.1.2 Providing missing values to the vector


NA in R signifies missing values (in SAS a missing value is denoted by a single
period.)

ajay2=c(23,45,78,NA,NA,89,NA)

is.na(ajay2)
## [1] FALSE FALSE FALSE TRUE TRUE FALSE TRUE

is.na() function is used to detect missing values in the vector.


14 SAS for R Users

2.4.1.3 To Input multiple columns of data

ajay3=data.frame(c("a","b"),c(1,2))

This creates a data frame with two columns as follows:

a 1
b 2

or, we can create a matrix using:

my_matrix = matrix(
c(2, 4, 3, 1, 5, 7),
nrow=3,
ncol=2)

This code makes a matrix with values in c() arranged in three rows and two
columns arranged column wise. Note: vector and matrix must have all values
of the same type but data frames can have values of different types.

2.4.1.4 Using loops to input

ajay=NULL
for (i in 1:20) {
ajay[i]=i}
print(ajay)

Output

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

2.5 ­Data Input in SAS


Data Input in SAS manually has been an easy task, however, there are a certain
set of examples where you can easily learn how to input data in SAS.
The INPUT statement reads raw data from instream data lines or external
files into an SAS dataset. Data input is the first step for every analysis; without
any dataset or data there can be no analysis of any kind. Data input could be
done in various forms lets see few examples of data input in SAS.
In the examples given below, we have input normal numerical data, strings,
names etc.
Data Input, Import and Print 15

data first;
infile datalines
input m n;
datalines;
5 10
10 20
20 40
;
run;

This code creates a dataset named first.

infile statement is used to specify the type of data to be read.


input statement is used to specify the names, number and type of variables
being read.
datalines statement is used to specify that the following lines contain the data
to be read.
The keyword “cards” can also be used instead of “datalines.”

data second;
infile datalines ;
input name$ points;
datalines;
ajay 10
kush 9
;
run;

$ sign is used to specify that the variable it follows is a character variable

data third;
infile datalines missover dsd;
input m n o;
datalines;
,2,3
4,,6
7,8,9
;
run;

Missover option is used to prevent the data step from going to the next line
if it does not find values for all variables in the input statement in the current
record. Here the dsd option is used to treat commas as separator characters.
16 SAS for R Users

2.6 ­Printing Data
After importing the data, the next important step is to print that data to have a
look at the type of data you now have to analyze.

2.6.1 Print in SAS


Printing the dataset in SAS involves calling the print procedure in SAS.
The code below will help you print the whole dataset named ajaydat.

proc print data=ajaydat;

run;

The code below will help you print the first five observations of the dataset
named ajaydat.

proc print data=ajaydat(obs=5);

run;

The code below will help you print the observations ranging from 10 to 20
for dataset ajaydat.

proc print data=ajaydat(firstobs=10 obs=20)

run;

2.6.2 Print in R
In R, printing of data does not need any function or package. You simply write
the dataset name and then run it to print the data.
If you read data in mydata and write the data_set name:
The whole data in mydata will be printed at console.

mydata=read_csv("file_path")
mydata
Data Input, Import and Print 17

Only the first observation of mydata is printed to the console. Default value
of n is 6.

head(mydata,n)

Observations ranging from 10 to 20 would be displayed.

mydata[10:20]

2.7 ­Summary
Importing data in R requires a variety of functions to import different types of
files whereas proc. import is used with different options or parameters to
import any type of file in SAS. Data input in R is done using the c() function
and using a data step with input option in SAS. In R, printing a dataset just
requires the writing of the name of the dataset and running it, whereas SAS
uses proc. print to print any dataset.

2.8 Quiz Questions


1 How will you load an installed package in R?

2 Give three functions which can be used to import csv files in R.

3 Which package contains read_csv() and fread() respectively?

4 Which function in R can you use to measure the time taken by a code to
execute?

5 Which procedure in SAS is used to import raw data files?

6 How can you create a temporary dataset from a permanent one in SAS
using a data step?

7 Which wildcard is used to specify that a particular variable is a character


variable in SAS?

8 What is the missover option used for in the infile statement in a SAS data
step?
18 SAS for R Users

9 How will you print a data set in R?

10 Which procedure is used to print a data set in SAS?

Quiz Answers
1 library(“package_name”)

2 read_csv(),fread(),read.csv()

3 readr, data.table

4 system.time()

5 proc. import

6 data temp_setname; set libname.permaset_name; run;

7 $

8 Missover tells SAS not to jump to the next line if it does not find values for
all variables. We just type the name of the dataset and run it to print a data
set in R.

9 Just type the name of object

10 proc print
19

Data Inspection and Cleaning

3.1 ­Introduction
Data Cleaning and Inspection is the next important part of the data analysis
pipeline. It implies that before starting analysis, visualization or machine learn-
ing and its insights, you should have cleaned any data that has to be analyzed.
Though Machine Learning, Exploratory Data Analysis and Data Visualization
take up more time in analytical education, in an actual data science project
much more time is spent in data inspection and cleaning.

3.2 ­Data Inspection
Data inspection helps us determine that data import has been executed
­correctly, that variables are in same length (rows) and breadth (columns) and
that variables (columns) are in the same format as expected.

3.2.1 Data Inspection in SAS


Let’s try this in SAS
●● Referring to a column is easier in SAS than in R

/* Refer to a column by using var in proc and keeping it by keep in data step*/
data import4 (keep=ozone2);
set import3;
run;

Creating a new variable which is twice the size of target column


data import4;
set import4;
ozone3=2*ozone2;
run;

SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
20 SAS for R Users

Printing only that variable by using var (which is also used in other Procs)
proc print data=import3 (obs=5);
var ozone2;
run;

●● Referring to a row is more complex in SAS than R

proc print data=import3 (obs=7);


run;

Obs Wind Temp Month Day Ozone2 Solar_R2 var2


1 7.4 67 5 1 41.0000 190.000 .
2 8 72 5 2 36.0000 118.000 .
3 12.6 74 5 3 12.0000 149.000 .
4 11.5 62 5 4 18.0000 313.000 .
5 14.3 56 5 5 35.3017 185.932 .
6 14.9 66 5 6 28.0000 185.932 .
7 8.6 65 5 7 23.0000 299.000

Using a do loop for getting certain rows

data output1;
do i = 1, 3, 4, 7;
set import3 point = i;
output;
end;
stop;
run;

proc print data=output1;


run;

Obs Wind Temp Month Day Ozone2 Solar_R2 var2


1 7.4 67 5 1 41 190 .
2 12.6 74 5 3 12 149 .
3 11.5 62 5 4 18 313 .
4 8.6 65 5 7 23 299 .

3.2.2 Data Inspection in R


●● head gives first 6 values
●● names give names of columns
●● dim gives dimensions (row column)
●● str gives structure (type of variables, variable names, dimensions) type of
data object
●● class gives type of data object (which is important in R as it can be many
different types of object)
●● summary gives a summary of the whole object including numerical analysis,
presence of missing values and frequencies of factor variables.
> data(airquality)
> head(airquality)
Ozone Solar.R Wind Temp Month Day
1 41 190 7.4 67 5 1
2 36 118 8.0 72 5 2
3 12 149 12.6 74 5 3
4 18 313 11.5 62 5 4
5 NA NA 14.3 56 5 5
6 28 NA 14.9 66 5 6
> names(airquality)
[1] "Ozone" "Solar.R" "Wind" "Temp" "Month" "Day"
> dim(airquality)
[1] 153 6
> str(airquality)
'data.frame': 153 obs. of 6 variables:
$ Ozone : int 41 36 12 18 NA 28 23 19 8 NA ...
$ Solar.R: int 190 118 149 313 NA NA 299 99 19 194 ...
$ Wind : num 7.4 8 12.6 11.5 14.3 14.9 8.6 13.8 20.1 8.6 ...
$ Temp : int 67 72 74 62 56 66 65 59 61 69 ...
$ Month : int 5 5 5 5 5 5 5 5 5 5 ...
$ Day : int 1 2 3 4 5 6 7 8 9 10 ...

>class(airquality)
[1] "data.frame"
> summary(airquality)
Ozone Solar.R Wind Temp Month Day
Min. : 1.00 Min. : 7.0 Min. : 1.700 Min. :56.00 Min. :5.000 Min. : 1.0
1st Qu.: 18.00 1st Qu.:115.8 1st Qu.: 7.400 1st Qu.:72.00 1st Qu.:6.000 1st Qu.: 8.0
Median : 31.50 Median :205.0 Median : 9.700 Median :79.00 Median :7.000 Median :16.0
Mean : 42.13 Mean :185.9 Mean : 9.958 Mean :77.88 Mean :6.993 Mean :15.8
3rd Qu.: 63.25 3rd Qu.:258.8 3rd Qu.:11.500 3rd Qu.:85.00 3rd Qu.:8.000 3rd Qu.:23.0
Max. :168.00 Max. :334.0 Max. :20.700 Max. :97.00 Max. :9.000 Max. :31.0
NA’s :37 NA’s :7

> class(airquality)
[1] "data.frame"
22 SAS for R Users

We can choose specific parts of a data frame by using square brackets, i.e.
●● airquality [2,3] gives data in second row and third column of airquality
●● airquality [2,] gives data in second row and all columns of airquality
●● airquality [,3] gives data in all rows and third column of airquality
●● airquality [R,C] gives data in Rth row and Cth column of airquality
airquality$Ozone gives value of Ozone column in airquality

3.3 ­Missing Values
Data that is missing can be due to human data input error, formatting issues or
incorrect coding syntax for import. It is a problem because we cannot have
analysis without data.
There are three ways to handle missing data:
1) Ignore it
2) Delete it
3) Replace it – Replace with a value that does not change the numerical prop-
erties significantly. Missing value imputation is the name given to replacing
missing data. At its simplest form we replace missing values by either mean
or median data. At its more sophisticated form, we use correlation from
other variables that are more complete to impute them. We can also use
machine learning algorithms to impute data from other variables. Specific
packages like mice package in R help with more sophisticated missing value
imputation.

3.3.1 Missing Values in SAS

File Import
FILENAME REFFILE '/home/ajay4/book/airquality.csv';

PROC IMPORT DATAFILE=REFFILE


DBMS=CSV
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;

Finding variable type. To our surprise many variables have been encoded as
string variables in SAS which were encoded as numeric in R. This is due to NA
being a character value in SAS but missing values in R. In SAS missing values are
denoted by a single period.
Data Inspection and Cleaning 23

PROC CONTENTS DATA=WORK.IMPORT; RUN;

Alphabetic List of Variables and Attributes


# Variable Type Len Format Informat
7 Day Num 8 BEST12. BEST32.
6 Month Num 8 BEST12. BEST32.
2 Ozone Char 2 $2. $2.
3 Solar.R Char 3 $3. $3.
5 Temp Num 8 BEST12. BEST32.
1 VAR1 Char 4 $4. $4.
4 Wind Num 8 BEST12. BEST32.

Let’s print the first six rows of data (similar to head function in R)
proc print data =import (obs=6);
run;

Obs VAR1 Ozone Solar.R Wind Temp Month Day


1 1 41 190 7.4 67 5 1
2 2 36 118 8 72 5 2
3 3 12 149 12.6 74 5 3
4 4 18 313 11.5 62 5 4
5 5 NA NA 14.3 56 5 5
6 6 28 NA 14.9 66 5 6

Let's replace NA in SAS

If we had to replace NA in just one variable, we can use


compress

data import2;
set import;
Ozone=compress(Ozone,"NA","");
Run;

proc contents data=import2;


run;

However, if we wanted to replace it in all character variables, we use an SAS


function called array with a ‘for’ loop and an ‘if’ statement. We convert ­character
variable one by one into numeric variables and drop the original. A point to note
is to avoid a dot in variable names in SAS. Drop is used in SAS to drop a certain
variable in the SAS dataset.
data import2;
set import;

array Chars[*] _character_;


do i = 1 to dim(Chars);

Chars[i] = strip(Chars[i]);
if Chars[i] = "NA" then Chars[i] =. ;
end;
drop i;
24 SAS for R Users

Ozone2=input(Ozone,2.);
drop Ozone ;

Solar_R2=input(SolarR,3.);
drop SolarR ;
var2=input(VAR1,8.);
drop VAR1 ;
run;

proc means data=import2 n nmiss mean;


run;

Using nmiss we can find and ignore the missing values in proc means (­similar to
na.rm. = T in R)

The MEANS Procedure

Variable N N Miss Mean

Wind 153 0 9.9575163


Temp 153 0 77.8823529
Month 153 0 6.9934641
Day 153 0 15.8039216
Ozone2 116 37 35.3017241
Solar_R2 146 7 185.9315068
var2 0 153

Suppose we ran the same Proc Means procedure but without nmiss, we will not
see the missing values (is.na = T in R).

The MEANS Procedure

Variable Mean

Wind 9.9575163
Temp 77.8823529
Month 6.9934641
Day 15.8039216
Ozone2 35.3017241
Solar_R2 185.9315068
var2
Data Inspection and Cleaning 25

But for character variables and others there is the following representation:

Missing Values Representation in Data

Numeric . (a single point)


Character ′ ′ (a blank enclosed in quotes)

For replacing a missing value in a character variable you can use:


if var=' ' then do;

To simply omit all missing values (like na.omit in R) we use the following SAS
code:
data import21;
set import2;
if Ozone2=. then delete;
run;

proc means data=import21 n nmiss mean;


Run;

You can see a few rows that also had solar_R2 have been deleted. Therefore, we
need to be careful about explicit deletion.

The MEANS Procedure

Variable N N Miss Mean

Wind 116 0 9.8620690


Temp 116 0 77.8706897
Month 116 0 7.1982759
Day 116 0 15.5344828
Ozone2 116 0 35.3017241
Solar_R2 111 5 184.8018018
var2 0 116
26 SAS for R Users

To replace missing values with the mean of the variable you can use the
following:
proc stdize data=import2 reponly method=mean out=import3;
var ozone2 solar_r2;
Run;

proc print data=import2 (obs=6);


var ozone2 solar_r2;
run;
Obs Ozone2 Solar_R2
1 41 190
2 36 118
3 12 149
4 18 313
5 . .
6 28 .
proc print data=import3 (obs=6);
var ozone2 solar_r2;
run;

Obs Ozone2 Solar_R2


1 41.0000 190.000
2 36.0000 118.000
3 12.0000 149.000
4 18.0000 313.000
5 35.3017 185.932
6 28.0000 185.932

3.3.2 Missing Values in R


Let’s do this in R
> data(airquality)
> summary(airquality)
Ozone Solar.R Wind Temp Month Day
Min. : 1.00 Min. : 7.0 Min. : 1.700 Min. :56.00 Min. :5.000 Min. : 1.0
1st Qu.: 18.00 1st Qu.:115.8 1st Qu.: 7.400 1st Qu.:72.00 1st Qu.:6.000 1st Qu.: 8.0
Median : 31.50 Median :205.0 Median : 9.700 Median :79.00 Median :7.000 Median :16.0
Mean : 42.13 Mean :185.9 Mean : 9.958 Mean :77.88 Mean :6.993 Mean :15.8
3rd Qu.: 63.25 3rd Qu.:258.8 3rd Qu.:11.500 3rd Qu.:85.00 3rd Qu.:8.000 3rd Qu.:23.0
Max. :168.00 Max. :334.0 Max. :20.700 Max. :97.00 Max. :9.000 Max. :31.0
NA's :37 NA's :7
28 SAS for R Users

We see the mean and then check for mean with missing values ignored using
na.rm. = T. We also check for total missing values by is.na. In R, as we have
mentioned, missing values are given by NA

> mean(airquality$Ozone)
[1] NA

Using na.rm+T we ignore missing values (in R they are NA in SAS


they are . )
> mean(airquality$Ozone,na.rm=T)
[1] 42.12931

> table(is.na(airquality))
FALSE TRUE
874 44

We can delete all missing values by na.omit

> airquality2=na.omit(airquality)

> str(airquality)

'data.frame': 153 obs. of 6 variables:


$ Ozone : int 41 36 12 18 NA 28 23 19 8 NA ...
$ Solar.R : int 190 118 149 313 NA NA 299 99 19 194 ...
$ Wind : num 7.4 8 12.6 11.5 14.3 14.9 8.6 13.8 20.1 8.6 ...
$ Temp : int 67 72 74 62 56 66 65 59 61 69 ...
$ Month : int 5 5 5 5 5 5 5 5 5 5 ...
$ Day : int 1 2 3 4 5 6 7 8 9 10 ...

> str(airquality2)

'data.frame': 111 obs. of 6 variables:


$ Ozone : int 41 36 12 18 23 19 8 16 11 14 ...
$ Solar.R : int 190 118 149 313 299 99 19 256 290 274 ...
$ Wind : num 7.4 8 12.6 11.5 8.6 13.8 20.1 9.7 9.2 10.9 ...
$ Temp : int 67 72 74 62 65 59 61 69 66 68 ...
$ Month : int 5 5 5 5 5 5 5 5 5 5 ...
$ Day : int 1 2 3 4 7 8 9 12 13 14 ...
‐ 
attr(*, "na.action") = 'omit' Named int 5 6 10 11 25 26 27
32 33 34 ...
..‐ attr(*, "names") = chr "5" "6" "10" "11" ...

We can use a conditional operator to replace missing values by median. In


the ifelse operator, the first part is condition, the second part is if condition is
true and the third part is if condition is false. We put the condition as is.na
Discovering Diverse Content Through
Random Scribd Documents
M. de Vesson’s rank and character intended no lawless violence if he
could accomplish his ends without it. He saw now that the two
Vessons were father and son, for there was a marked likeness,
although the elder man had a face of far more force and nobility.
The four noblemen wore the rich dresses suited to their condition,
and were in strange contrast to their bound and dishevelled captive,
although Péron measured them with a glance of proud contempt.
There was a significant silence for a few moments after the arrival of
the prisoner and his guards, and then the elder Vesson, who seemed
to be not only the senior but the leader of the party, spoke,
addressing Péron in a tone of haughty command.
“Young man,” he said, “you are known to be a spy and a go-between
for one you wot of. If you will make a full confession of the whole
matter and give up any papers or information which you have,
without further delay, you need fear no personal injury; but if you
continue your stubborn resistance, you must take the
consequences.”
He paused, waiting for the prisoner’s reply; but Péron, by force, was
silent, and he assumed an air of sullen obstinacy to suit his
speechlessness. The cavaliers around M. de Vesson were manifestly
impatient and dissatisfied because any leniency was shown, and that
nobleman’s son interrupted the pause.
“He is a stubborn devil as well as a braggart and a bully,” he
remarked scornfully, the recollections of Péron’s treatment of him
having left a sting that rankled. “You will get nothing from him
unless you break his neck.”
Convinced that Péron did not intend to make terms by any act of
treachery, the elder Vesson made a sign to his guards.
“Search him, Guerin,” he said sharply, “and be thorough, for we deal
with one as cunning as a fox in his devices to obtain messages with
impunity.”
The two soldiers did not need his injunctions, and they did their
work so thoroughly that Péron feared that they would even find the
cardinal’s ring in its hiding-place in the lining of his coat, but they did
not; and more to their astonishment there were no papers, not a
scrap of writing on his person. They searched his stockings and his
boots, but in vain, and the noblemen looked on in evident disgust.
“He carries the message in his mind,” remarked M. de Vesson, in a
tone of sharp disappointment.
“Then it is best to make short work of his head and the message as
well,” replied one of the others, fiercely.
“Perhaps he can be bought,” suggested another, in an undertone.
Vesson shook his head. “Nay,” he rejoined in the same low voice,
“trust monsignor for knowing his man; and that young fellow is not
made of the stuff which is easily corrupted.”
“He claimed to be a Calvisson,” said the younger Vesson; “did you
hear him at the inn?”
“I did not heed him,” returned his father, and then added, after a
sharp look at Péron: “Pardieu! Can it be possible? I see a likeness
now—the likeness that has troubled me since I first saw the fellow.
Can it be?—after all these years?”
This conversation was held apart, but Péron saw the change in their
looks and gestures and marvelled at it. Meanwhile, Neff had made a
curious discovery which caused him to stare open-mouthed from the
prisoner to his own superiors.
“M. de Vesson, I have found the token on his person!” he cried,
holding up Renée’s watch in evident amazement.
There was an exclamation of surprise from all the others except M.
de Vesson, who received the statement calmly.
“Yes,” he said, “I remember; it was the token that led to the error at
St. Gudule.”
This speech was all that was needed to convince Péron that these
men were the same he had met in the house of Marie de’ Medici,
and he kept his lips resolutely closed although Père Matthieu’s ball
pressed hard into his tongue.
There was another low-voiced consultation between the leaders, the
three younger evidently urging a course of which M. de Vesson did
not approve, and after some dispute he prevailed.
“To horse!” he said. “A day’s journey without breakfast may do much
to moderate this fellow’s obstinacy. Forward therefore, gentlemen,
without delay.”
Following his instructions, they resumed their journey, Péron again
penned in his litter, like a sick woman, and not allowed speech with
any one. Thus they rode through Beauvais, without halting, and took
the way to St. Denis with all speed. At midday they halted to eat and
to bait their horses, and then it was that Péron was surprised by the
actions of Guerin Neff. Since the discovery of mademoiselle’s watch
the fellow had shown a certain awe and respect for his captive, and
now when he alone was on guard, he took the opportunity to thrust
the trinket into Péron’s hand.
“Take it,” he said gruffly. “I know not how you came by it, but I will
not meddle with it. I have seen more than one honest man lose his
head for meddling with the business of Madame la Mère; I will none
of it.”
Péron took the trinket without reply; he had the cardinal’s message
again in his mouth and could not speak, if he would, and Neff
interpreted his silence as a mere continuance of his sullen mood.
After that, the prisoner was left undisturbed; only once was any food
thrust into the litter, and that also was given by Guerin Neff. It was a
weary journey, but Péron had cause to congratulate himself on his
success: no one as yet even suspected the cause of his persistent
silence, and but for the discomfort of the device, it seemed an easy
and simple means of duping the enemy. All things come to an end,
however, and he could not avoid some dreary speculations upon the
probable termination of his adventure. Shut in as he was, he could
not discover their road or where they intended to go, except that the
general direction was toward Paris; and he was aware that they
finally crossed the Seine not far from Rouen, which showed that they
had quitted the road to St. Denis, taking a more westerly course. He
had nothing to expect but imprisonment or death. He reflected that
they were not likely to let him escape to bear the tidings of his
capture to Cardinal Richelieu, and to give him the information which
they had failed to take from him. Cramped with his bonds, and
weary from need of sleep which he dared not take, he lay, at last,
indifferent to fate and merely awaiting the end.
It was night when the party finally halted before a château, and
after a brief delay Péron was roused from his despair by hearing the
others dismount and seeing the flare of torches about his litter.
Evidently they had reached their destination, and he rallied his
drooping energy to meet the climax. After some time he was taken
from the litter and unbound. He shook himself with almost the joy of
an animal at feeling his limbs free, and looked about him. They were
in a courtyard at the rear of a large house, and the place was quite
lively and noisy from the sudden arrival of so large a party. Two
torches served to partially dispel the gloom, and he saw that there
were several grooms and hostlers running about among the horses
and that the light streamed out from the open door of the château.
Before he could observe more he was taken by his two guardians
and led up the steps into the house. Here were the others, M. de
Vesson, his son, and his friends, standing in a group in the center of
the hall, talking to a young and beautiful woman, whose brilliant
dress showed in the light of many tapers. Péron caught his breath;
to his amazement he recognized the proud face and golden hair of
Renée de Nançay. In a moment he understood the détour around St
Denis; they had come to Nançay, being relatives and fellow-
conspirators of the marquis. After the first shock of surprise Péron
fixed his eyes on mademoiselle, wondering what would be the
outcome of the strange trick of destiny which made him now
virtually her prisoner. But Renée made no sign; she was no longer
the defiant girl of the Rue St. Thomas du Louvre, or the plucky little
conspirator who had defied him at the house of the Image de Notre
Dame. She was the haughty demoiselle, the great lady of the
château; she looked at him without recognition, with cold hauteur
and indifference. He heard her reply to M. de Vesson’s request for
some place to bestow the prisoner.
“Certainly, monsieur,” she said in a clear voice, without another
glance at the young musketeer; “the cell in the west wing, near the
north tower, is the strongest; my steward will direct your men where
to bestow him according to your pleasure.”
Her back was toward Péron now, nor did she turn her head when he
was led away to go through long halls and down two flights of stairs
and to be locked at last a prisoner in a cell in his father’s house.
Thus he was securely locked and bolted in the narrow room and left
to reflect upon the strange trick of fate which made him a captive
where he should have ruled as master.
CHAPTER XXIII
THE DUNGEON OF THE CHÂTEAU

THE room in which the prisoner was confined was a small one in the
cellar of the Château de Nançay, and was strong enough to resist his
greatest efforts to effect an escape. That had been his first thought,
and, as soon as the bolts were shot and his guards departed, he
devoted himself to an exhaustive but unprofitable examination of the
place. He was provided with a rushlight, and was thus enabled to
make his observations with comparative ease. However, a few
moments sufficed to convince him that it was fruitless to look for a
possible means of egress. There was but one door, that by which he
had entered, and which was sufficiently secure to resist twenty men
as well as one, unprovided as he was with any lever to force the
bolts and bars; and the only window, situated too high for him to
look out of, was two feet long by ten inches in height and barred.
Through it an occasional gust of night air chilled the room and made
the rushlight flicker. He noticed with some surprise—and strange
thoughts of mademoiselle’s charity—that there was only a bench in
the cell, and that too short and narrow for a man to lie on. If he
slept to-night it must be on the floor; and he was already almost
overcome with physical exhaustion from his unremitting
watchfulness. A pitcher of water and a bowl of soup had been put
upon the bench, and he ate the pottage with good appetite, for his
fast had been almost unbroken since he left Amiens. He experienced
a sensation of relief, at escaping the vigilance which had tormented
him, and being secure of a few hours in which to rest without
holding that hard ball between the roof of his mouth and his tongue.
He wasted no further time in speculations as to the morrow; he ate
his food and drank from his pitcher of water, and then, having
hidden Père Matthieu’s message as securely as he could in his
clothing, he made a pillow of his cloak and stretched himself on the
hard stone floor with a sigh of comfort. There is no sleep sweeter
than that which comes to the weary, and he had earned a right to
unbroken slumber. However, unconsciousness did not come so
quickly as he had expected; he lay for a long while thinking of
Mademoiselle de Nançay’s manifest indifference to his fate, and the
ease with which she consigned a political enemy to a comfortless
dungeon. He could not reconcile this apparent cruelty with the
kindness that had given him a token which, in all probability, had
saved his life. He was visited, too, by other thoughts and with the
recollection of Madame Michel’s description of the manner in which
he had been saved, when a helpless infant, from his father’s enemy.
He thought, too, of his visit, when a boy, to the château with
Jacques des Horloges, of his prayer in his dead mother’s room, of
Renée and her bunch of violets on the terrace. As he lay there on
the dungeon floor he fancied that he could hear the bell of the great
jacquemart, which Michel regulated, ringing for eleven o’clock, and
from that his mind went back to the chimes in the little shop on the
Rue de la Ferronnerie and of his childhood and M. de Turenne. At
this his thoughts trailed off into unconsciousness, and the exhausted
musketeer slept the sleep of the tired and the innocent.
He did not know how long he had slumbered, but it seemed scarcely
an hour, when he was awakened by the opening of the door of his
cell. The bolts were rusty, and they slipped back with a grating
sound which roused him at once. His rushlight had gone out, but the
persons who opened his door bore a taper which served to reveal
them to his startled eyes. He had expected Guerin Neff or one of the
retainers of Nançay, but instead of these he saw two women: one,
short and thick, held the taper which shone in her face—it was
Ninon; the other, smaller and slighter, he recognized with surprise as
Renée de Nançay. At the first sound he had started to his feet, and
he stood now regarding them in much perplexity, but without
uneasiness in regard to his trust; of two women he had no need to
be afraid. Mademoiselle’s treatment of him in the hall had been such
that he gravely waited for her to speak. They came in, however,
without a word, and closed the door behind them; then he saw that
Renée held a sword and a pistol in her hands as well as a mask. All
these things she laid upon the bench before she spoke. She was
evidently surprised at her reception, and her face flushed deeply as
she turned to address him.
“Sieur de Calvisson,” she said haughtily, “yonder are weapons and a
mask: assume them and prepare to follow Ninon, who will let you
out of the château. I would have you know, monsieur, that it was no
petty spirit of revenge which made me send you to this comfortless
den. I chose it because, forsooth, I could the more easily release
you.”
“Mademoiselle, you but increase my gratitude,” Péron replied, in a
low voice. “Your trinket saved me, as I believe, upon the road, and
now you are my liberator; your justice to the messenger will
doubtless have its weight with monsignor.”
She turned upon him with sparkling eyes.
“Monsieur,” she said proudly, “I do not care a jot for M. le Cardinal; I
would not move my finger to serve him or his cause, but no man
shall suffer wrong in the Château de Nançay while Renée is mistress
here. I pray you take your weapons and begone, for I cannot
promise protection should my relatives overtake you in your flight.”
“Mademoiselle, I thank you for the warning; but with my sword and
pistol in the open I trust to shift for myself,” he replied, not without
feeling; but he obeyed her, knowing himself to be an unwelcome
guest.
She watched him in silence while he assumed the weapons and his
cloak and mask, and something in the expression of his face
softened her mood. When he was ready she signed to Ninon to open
the door, and then she turned for her last words to him.
“Ninon will guide you, monsieur,” she said, not unkindly, “and you
will find your own horse, saddled and bridled, by the wall on the
highroad. They brought it from Amiens, the better to carry out the
farce they acted at the Rose Couronnée. One of my own trusted
grooms holds the horse now against your coming. Mount him and
make good speed to Paris, for at morning they will be looking for
you. That is all—except, monsieur, beware of the Golden Pigeon at
Poissy; some of the party may be there to-night.”
She lighted her taper at Ninon’s and started as if to leave them; but,
before she could prevent it, Péron knelt on one knee at her feet and
kissed her hand.
“Mademoiselle de Nançay,” he said softly, “believe that I am not
ungrateful—or ignorant of the risk you take to aid me.”
“Monsieur,” she replied, and for the first time her voice faltered, “I
have done nothing but that which my father’s honor demanded.”
She spoke with dignity; but Péron saw the tears shining in her dark
eyes, and moved by an impulse he pressed her hand to his lips again
as he rose to his feet. She drew it away with a deep blush.
“Go, monsieur,” she said shortly; “there is not a moment to lose, it is
nearly two o’clock.” And with these words she left them.
Ninon lost no time in fulfilling her mistress’ instructions. She signed
to Péron to follow her, and in silence they went through the winding
labyrinth of the cellars until they came to a postern, which she
opened cautiously; after looking out to see if all was quiet, she
extinguished her taper and led the way into the rose garden of the
château. The night was intensely dark, and Péron stumbled more
than once in making his way among the thorny bushes; but at last
they came to a terrace, and descending it found themselves by a low
stone wall. As they reached this spot Péron heard a horse neigh and
Ninon paused.
“Climb the wall, monsieur,” she said curtly, “and on the other side is
your horse.—Adieu!”
She left him without waiting to listen to his thanks; and he did not
linger, but vaulting over the low wall found his horse held by a
groom, as Renée had said. In the darkness he could not see the
man’s features, but he was expected.
“From Mademoiselle de Nançay?” asked the servant.
Péron replied in the affirmative and in a moment more was in the
saddle, a free man again with his sword by his side. He took one last
look at the dark outlines of the château, in which one light shone
from the western tower, and then he set his face toward Paris, with
a lighter heart than he had carried in his bosom since he left
Brussels.
He made good progress, although he had to make a détour at Poissy
to avoid the Golden Pigeon, and he did not halt until he reached
Ruel, where he stopped only long enough to ascertain that the
cardinal was in Paris. The ride was uneventful; and it was evident
that mademoiselle had deluded his captors, for there were no signs
of pursuit, and he rode down the Rue St. Honoré at last, with the
message from Brussels safe in his bosom.
He did not pause even to arrange his disordered dress, but went at
once to Richelieu to discharge his trust. The cardinal listened to his
account with a grim smile.
“You erred in following—from idle motives—the stranger at St.
Gudule,” he said calmly; “from that probably arose your troubles,
which were a just and legitimate retribution. Otherwise you have
done well and deserve well at my hands. You have to-day placed in
my hands evidence that will convict the enemies of the state, that
will open the eyes of the king to the peril in which we have stood,
and show him whom he can trust. M. de Calvisson, there are two
ways for a man to die: in doing his duty, or for betraying it—always
choose the former.”
Two hours later Péron had again assumed the scarlet uniform of the
cardinal’s musketeers and was making his way to the shop at the
sign of Ste. Geneviève with a light heart, having successfully
executed his commission and conscious that he stood well with
Richelieu, who was ever chary of his praise, though quick to censure
neglect and unforgiving of disobedience.
It was the fête of St. Barnabas, and the shop on the Rue de la
Ferronnerie was empty when Péron entered it, but at the sound of
his footsteps Jacques des Horloges came out of the inner room
followed by Madame Michel. In both their honest, kindly faces Péron
read disappointment and surprise as they saw him in his old
uniform; these simple folk longed to hail him by his proper title, to
see him in his father’s place, and they could not understand what
seemed to them his lack of ambition. However, they greeted him
with their accustomed cordiality and affection, and the shop being
vacant, the three sat down amid the tall clocks and the short clocks,
which stood in the same close tiers as in the days of Péron’s
childhood; and as the cat, a gray one too, came out from behind the
jacquemart and rubbed himself against them, it seemed to the
musketeer that the years had not been, and that he was still the
clockmaker’s adopted child, with his speculations about the
mysterious attic and his legends of the many clocks; and his eyes
rested dreamily on the cross-shaped watch of M. de Guise. He was
not permitted to enjoy this revery; for they had a hundred questions
to ask, and he strove to answer them to their satisfaction, for his
heart was warm with grateful affection for this faithful couple. They
heard all that he felt at liberty to tell them of his journey,—its perils
and its happy termination. Madame listened between tears and
smiles, clasping her hands and murmuring an occasional
thanksgiving as she heard of his narrow escape. Jacques was
differently affected. He had been reared a soldier, and the account of
such adventures stirred his blood; there was a gleam in his eye, a
tightening of the lips that told, more plainly than words, how he
wished he had been there to strike a good blow at the opportune
moment. The scene in the old shop was full of homely interest, the
beautiful and quaint clocks forming a picturesque setting for the
three figures,—the stalwart clockmaker leaning on the counter, his
gray head a little bent as he listened, Madame Michel sitting in a low
chair, her hands clasped and her broad, brown face illumined with
affection and amazement under the white wings of her wide cap,
and opposite the graceful figure in its scarlet uniform and the
handsome face of the musketeer, who held the gray cat on his knee
absently caressing it as he talked. When he told of mademoiselle’s
trinket, Jacques immediately showed a new interest and asked to
see it; he held it a moment in his hand, looking at it attentively, and
then he smiled.
“I know this watch well,” he said; “I made it myself.”
“I thought I knew something of watches,” Péron remarked, “and I
took that for one of the Valois period.”
“That shows my skill,” replied the clockmaker, in an amused tone. “It
is a copy of a Valois watch belonging to the queen-mother. I made
twenty of these, though I only dimly divined their purpose, and all
have this secret spring.” As he spoke he pressed the side of the
watch and it opened to reveal a miniature. With a smile he held it
out to Péron, “You know its secret virtue now,” he said.
The miniature, though exceedingly small, was an excellent
representation of the Italian features and round eyes of Marie de’
Medici.
“I should never have made this discovery,” Péron said, “nor do I
think that Guerin Neff opened it.”
“There was no need,” rejoined Jacques, pointing to the cover; “they
all bear that tiny fleur-de-lis upon them, and are all of exactly the
same size and shape.”
The trinket had to be handed to Madame Michel to examine, and
while she was marvelling at her husband’s skill, he went on to speak
of other things.
“M. de Vesson is a half-brother of Pilâtre de Nançay,” he said, “and
like enough to be up to the elbows in the same business. ’Tis
strange that monsignor let that rogue go.”
“What rogue?” asked Péron quickly.
Both Jacques and his wife looked up in surprise.
“Did you not know that M. de Nançay had been set at liberty?” asked
the clockmaker. “I saw him yesterday on the Rue St. Martin with an
escort of gay gentlemen. There was much gossip, so says
Archambault, about the arrest and the release; ’tis thought that
monsignor but baits his trap for larger game.”
Péron was silent, perplexed and uneasy at this turn of events. It was
impossible, however, for any man to probe the cardinal’s purposes; it
was not unusual for him to let a victim apparently escape from his
toils for the sole purpose of more deeply involving him. It might be
so with M. de Nançay; it had been so with Chalais; but Péron could
not understand, and it presented matters in a new light: it bore
directly on his own future.
“I cannot forgive him for letting the rascal go,” Madame Michel
remarked, breaking in on the thread of his meditations; “if a man
ever deserved to lose his head it is Pilâtre de Marsou, sometimes
called Marquis de Nançay. Mère de Dieu! I wonder that his flesh
does not creep at the name, for verily ’twas he who murdered your
father and would have murdered you. Ah, I have not forgotten that
night in the woods, and how I prayed and wept with the poor
fatherless baby in my arms. I know that the bon Dieu will reward
him according to his merits. I recollect how I said over and over the
words of the psalm: ‘Qu’une ruine imprévue accable mon enemi;
qu’il le prenne au piège qu’il a dressé lui-même, et qu’il tombe dans
les embûches qu’il m’a préparées.’ And I believe that it will be so, for
even Père Antoine, who is an angel of forgiveness, says that
retribution comes surely upon the wicked—either at seedtime or
harvest.”
CHAPTER XXIV
THE CARDINAL’S RING

IN the Rue des Bons Enfans, behind the gardens of the Palais
Cardinal, Péron had his lodgings. He had long since outgrown the
proportions of his little room over the clockmaker’s shop; the old
house at the sign of Ste. Geneviève was too small to accommodate
the three grown people and the apprentices, and he had taken up
his quarters near the scene of his daily employment. He had two
upper rooms in a house but a little way from the rear of
Archambault’s pastry shop; his means were limited and his
requirements few and simple, so the apartments were plainly and
neatly furnished. He had left the little room on the Rue de la
Ferronnerie untouched; it was to him full of tender recollections of
his childhood, and he knew it was dear to the motherly heart of
good Madame Michel, who looked upon him almost as her own son.
It was in these rooms on the Rue des Bons Enfans that he made a
discovery which amazed and alarmed him. He had been twenty-four
hours in Paris before he recollected the cardinal’s ring, which he had
hidden in the lining of his coat, and when he went to look for it, to
his surprise, it was not to be found. He remembered that it had
escaped the vigilance of M. de Vesson’s searchers, and he could not
account for the loss. In his anxiety, he cut the lining entirely away
from his coat, but revealed nothing. It was dusk when he made this
discovery of his mishap, and he lighted a taper and kneeled on the
floor, searching with patience and exhaustive scrutiny every corner
and crevice of the room. The furniture was scanty, and the light
shone into the most remote spots, but showed nothing. He was
convinced that the ring was in the coat when he took it off to
assume his uniform, nor could it get out of its own accord. He had
dressed hastily to attend the cardinal to mass at his parish church of
St. Nicholas des Champs, and in his hurry he had forgotten the ring.
No one had entered the rooms in his absence, for the doors were
both secure and the keys in his pocket. Then he recollected the
windows. There were three; the two in the front room overlooked
the street and were inaccessible, but the one in the inner room
opened within three feet of the slanting roof of the adjoining house,
which, however, appeared to be unoccupied. If any one had entered
his rooms, it must have been through that window, but he saw no
signs of it. It was possible for a man to walk along on the roofs of
the other buildings and come down on the roof opposite his
quarters, but why should any one suspect him of carrying the ring,
and know where to find it? If the men of Vesson’s party had seen it,
they surely would not have hesitated to take it. What had become of
the circlet? It could not effect its own escape, that was certain, and
he could not imagine that it had fallen from its place, so securely
had he fastened it. Moreover, he was not alone confronted with
anxiety at the loss; he was liable to be called upon to produce it at
any moment by Richelieu, who had for the time overlooked it, but
who never forgot. His ceaseless vigilance noted all things, small and
great, with the same untiring energy and patience. It was with
profound anxiety, therefore, that Péron continued his search, and it
was only when he was absolutely certain of its fruitlessness that he
ceased to look in every possible spot where the precious ring could
have been mislaid. At last, he was compelled to go on duty again to
attend the cardinal to the Louvre, whither he went like a man in a
dream. He was too full of his own perplexities to observe the gay
scenes in the galleries of the palace, where M. le Grand was at the
height of his power and arrogance, unconscious that Richelieu’s web
was already about him. Père Matthieu had sent from Brussels
evidence of M. le Grand’s correspondence with the Vicomte de
Fontrailles, who had already been selected as the messenger that
the conspirators were to send to Madrid to conclude a treaty in the
name of Monsieur. For Péron had aided in the first steps to expose
the plot of Cinq Mars, which was already partially woven. In the
Louvre, too, Péron came face to face with his old patron, the Prince
de Condé, who greeted him kindly, recalling with a smile the victory
over Choin in the tennis court and saying that monsignor had spoken
highly of the musketeer’s courage and address. The prince’s
condescension and his mention of the cardinal’s commendation
suggested to Péron the possibility that his real station in life was
already known among a few, and that M. de Nançay’s strange
liberation had some secret meaning. But all these thoughts did not
allay his anxiety over his loss, which might be attended with such
serious results, the bearer of that ring being able to gain easy access
to the house of the iron cross, and perhaps to fool even Père
Matthieu. Yet a vision rising before him of the stern-faced, keen-
eyed priest afforded him some reassurance, for it would be difficult
indeed to outwit him.
It was midnight when Péron was at last at liberty to return to his
lodgings. He was weary and abstracted, and made his way through
the gardens of the Palais Cardinal to the Rue des Bons Enfans. At his
own door he found a little ragged boy of the street sitting on the
stone step, and thought the child had selected this spot to sleep; but
at his approach the small figure rose. It was too dark for either one
of them to distinguish the features of the other, and only the lantern
which hung above the door revealed the ragged outline of the boy.
He peered through the darkness at Péron as he came up.
“Are you M. de Calvisson?” he asked.
“I am,” replied Péron, surprised at the recognition. “What do you
want of me at this hour, child?”
“I have a letter for you,” he replied, thrusting a note into Péron’s
hands and turning away at once.
“Not so fast,” exclaimed the musketeer, intending to detain the
messenger; but the boy was fleet of foot and had fled away in the
darkness, without pausing to hear what Péron had to say.
Annoyed and amused by the little vagabond’s manner of delivering
missives, Péron had no resource but to enter the house and get a
light by which he could read the letter so strangely sent to him. The
contents startled him more than the manner in which he had
received it. The writing was delicate, like that of a woman, and he
recognized the seal. The note was brief and to the point; it ran:—
“M. de Calvisson,—If you will meet the writer at the stone
bridge by the Cours la Reine, you will receive the ring
which was lately stolen from you. If you come not by nine
o’clock on Thursday morning, you will lose the opportunity
forever—and the ring.
R. de N.”
The seal and the initials were those of Renée de Nançay; yet Péron
was not only perplexed, but doubtful. He had never seen
mademoiselle’s writing, but something in the letter raised his doubts;
he suspected a trap. This was Tuesday; he had therefore one day in
which to endeavor to fathom this mystery, and he resolved to use it.
Of one thing he was no longer uncertain: the ring had been stolen.
As it was already past midnight and he could accomplish nothing for
the next few hours, he wisely spent those in an effort to rest; but he
slept little, for now, in addition to his anxiety in regard to the
cardinal’s ring, was the fresh perplexity of the note, which might and
might not be from mademoiselle. Péron did not misunderstand her;
he knew that what she did was prompted rather by her disgust at
the treachery that she saw about her than from any kindness toward
him, though once or twice he had thought that with all her hauteur
Renée was not wholly indifferent to his fate. He knew that in her
eyes there was a great gulf fixed between them, which not even her
love or his could span. Mademoiselle, the daughter of a marquis,
one of the grand demoiselles of France, could scarcely afford to lose
her heart to the cardinal’s musketeer. Péron, conscious of his own
noble birth, watched the young girl’s proud defiance with a pang at
the thought that the revelation of his rank would but widen the
breach. As for the note, the appointment at the lonely spot was
unlike a woman. On one side of the Cours la Reine, the road to the
king’s hunting-lodge at Versailles divided it from the Seine; on the
other were ditches which ran between the promenade and a barren
plain; and across these ditches was, at one place, a small stone
bridge. A spot more lonely at that hour of the morning could
scarcely be found, and it seemed wholly unsuited to a visit from a
young woman, yet it had the one advantage of being isolated and
little visited by those who would be likely to recognize Mademoiselle
de Nançay. Whichever way Péron regarded the matter, he found it
perplexing, but he never thought of failing to keep the tryst. There
was no risk save to himself, and he was not one to hesitate because
of personal danger. It lent a zest to every adventure, and he would
have lamented its absence.
He devoted some time the following day to a fruitless endeavor to
probe the mystery. It was of course impossible to discover the
bearer of the letter, and he found it equally difficult to obtain any
other information beyond the bare fact that Mademoiselle de Nançay
had been in Paris the previous day, at her father’s house on the Rue
St. Thomas du Louvre. This lent a color of possibility to the incident.
Further than this, Péron was unable to push his investigations, and
at nightfall on Wednesday he knew as little as ever, but he had fully
determined to go to the stone bridge on the following morning,
taking only the precaution to wear his hallecrèt and to go well armed
and prepared for any emergency.
He supped with Madame Michel at the clockmaker’s shop,—a custom
to which he always adhered unless on duty at the Palais Cardinal,—
but he returned early to his rooms on the Rue des Bons Enfans. He
had kept a persistent watch there since the loss of the ring, having
some fancies about the window, which he still suspected as the way
by which his quarters had been entered. It was after nightfall, and
he had lighted his tapers and sat down at his table to read; for Père
Antoine’s early training had cultivated his taste for books. It was
while he was thus quietly engaged that he became aware of light
footsteps on the stairs outside his door, and the rustle of a woman’s
garments. He stopped in surprise and listened, his eyes upon the
door. In a moment he heard a whispered consultation, and then
something brushed against the panels. He said nothing, waiting to
see the sequel or to hear it. Presently there was a timid knock,
followed by the low murmur of voices. He waited no longer, for his
curiosity was fully roused, and undoing the latch he threw open the
door, revealing two cloaked and masked women on the other side.
Without hesitation, the smaller of the two entered the room,
followed by the other, and signed to him to close the door. He did so
in surprise and bewilderment, and was not sure of his recognition
until Mademoiselle de Nançay removed her mask. She was very pale,
but her eyes sparkled with excitement and resolution, and she
scarcely heeded Péron’s salutation.
“M. de Calvisson,” she said, with quiet dignity of manner, “you must
think it strange indeed for me to come here—and in this manner—
but I learned only an hour since of the snare that had been set for
you; that my name had been used for a cruel deception, and I could
not rest until I set it right. Monsieur, you received a note purporting
to come from me and summoning you to keep a tryst at the stone
bridge by the Cours la Reine. That letter was a tissue of falsehood.”
Péron bowed gravely. “Mademoiselle,” he said quietly, “I never
believed that the letter was yours, but I should have kept the
appointment.”
“Mon Dieu!” she cried with sudden emotion, “you would have kept it
to your death—and I should have been the means of it!”
She pressed her hands before her face, shaken by an emotion too
deep to conceal. Péron watched her with a strange confusion of
feeling, his heart beating high with sudden hope.
“Mademoiselle,” he said, too low for any ears but hers, “if my death
would cause you regret, it would be robbed of much bitterness.”
She looked at him with startled eyes, a beautiful blush mounting to
her fair hair, and then she drew back haughtily.
“I came here from a sense of duty, monsieur,” she murmured in a
strange voice. “I could do no less—I know not what you think of
me!”
“That you are an angel, mademoiselle,” he replied, “too noble and
too just to let a man’s life be sacrificed by the use of your name.”
She gave him a questioning glance, as though she doubted the
sincerity of his words and feared that he misunderstood her motives.
Her pride was up in arms and she put on her mask, securing it with
trembling fingers.
“There is no more to tell, monsieur,” she said coldly; “if you go to the
Cours la Reine, you will meet your death—and I did not write that
letter—that is all. Come, Ninon, we must away.”
Péron could not delay her, but he picked up his sword.
“Mademoiselle,” he said, “permit me at least to attend you through
the streets.”
She halted at the door, confused; her woman had gone out upon the
stairs, and the two stood face to face.
“You cannot go, monsieur,” she said, with a falter in her voice; “your
attendance upon me would lead to worse trouble for you—and for
me!”
“If it touches you, mademoiselle, I will not stir,” he replied;
“otherwise, I pray you not to deny me the small privilege of
attending one who has thrice saved my life.”
“It would be my peril, Sieur de Calvisson,” she said softly. “Adieu!”
She hesitated on the threshold, her mask hiding her face; then she
held out her hand and he took it in both his.
“Mademoiselle,” he said, very low, “I would cheerfully give my life to
defend yours, and the time may come when I pray you to remember
that I will accept no benefit which shall be to your detriment.”
He thought he saw surprise in her eyes; but he pressed her hand to
his lips, and in a moment she was gone and he heard her light
footfall on the stairs. Flushed with emotion, and with a hundred
conflicting thoughts, he moved to the window to watch her leave the
house; but as he saw her come out on the step below, he heard
some one in the hall, and looking up, saw Ninon on the threshold.
“Mademoiselle dropped her handkerchief, I think,” she said,
pretending to search upon the floor.
Péron took the taper from the table to aid her, and the two stooping
down to look beneath the table came very near together. It was then
that the woman found her opportunity.
“Be wary, monsieur,” she whispered, giving up the pretended search;
“they know who you are—and I do, though mademoiselle does not—
and they mean mischief.”
In a flash the truth burst upon him, the Nançay faction knew whose
son he was.
“Ninon,” he said earnestly, “I pray you not to tell mademoiselle!”
She was at the door again, and she gave him a strange look.
“Do not be a fool, monsieur,” she said with blunt kindness;
“mademoiselle has been betrothed to M. de Bièvre for a
twelvemonth; and her father—ah, M. le Marquis is a devil!”
With these words Ninon hurried from the room and ran down the
stairs after her mistress, leaving Péron standing in the middle of the
room, like a man turned to stone.
CHAPTER XXV
ARCHAMBAULT’S INFORMATION

NINON’S announcement, coming with unexpected force and with


truthfulness, dashed Péron’s new-born hopes to the ground.
Mademoiselle’s flashes of tenderness and emotion were but the
whims of a coquette, who found amusement and flattery even in the
admiration of an inferior. The Renée that he knew, with her varying
moods of anger and disdain interspiced with glimpses of soft-
heartedness, was doubtless very different from the fiancée of M. de
Bièvre. Péron tried to recall what he knew of the man, a cousin, he
thought, of the Prince de Condé, and a man of some wealth and
pretensions,—not an unsuitable match for mademoiselle in family
and rank, but by repute a brainless young courtier and something of
a roué. Yet, after all, that was Renée’s affair, not Péron’s. He thought
that he had seen him once or twice at the Palais Cardinal or the
Louvre, and that he bore a strong likeness in dress and manner to
the younger de Vesson. Doubtless she was accustomed to men of
this stamp and preferred them to a soldier of fortune—a musketeer.
In the half-hour after mademoiselle left, Péron had these thoughts
and many others more bitter, and called himself a fool many times
for having yielded to the charm of a fair face and two bright eyes.
He had known from the first of a barrier between them that should
be impassable, yet he had let a tenderness grow in his heart, and
deserved punishment for his folly. So completely did mademoiselle’s
betrothal fill his mind that he forgot the cardinal’s ring, forgot his
surroundings, the taper burning low on the table, forgot the
unbolted door, until he heard a step on the stairs and rose to fasten
his latch. He was too late; before he reached it the door was opened
softly and the round face of the pastry cook was thrust into the
space. Seeing that Péron was alone, Archambault came in, and
shutting the door behind him with his shoulder, advanced to the
table, where he set down a large frosted cake with an air of
satisfaction.
“Pardieu!” he said, rubbing his hands, “I had to have an errand, and
I brought you one of the cakes that you used to love. You would run
all the way from the Rue de la Ferronnerie for one of these when
you were eight years old; ay, when you were a big boy of fourteen
and with M. de Condé, you had still an affection for my cakes.”
“I thank you, Archambault, not only for the present but for the old
times,” Péron replied smiling, though he wondered what had brought
the fat pastry cook up all those steps for so flippant an errand.
“You are welcome enough, M. Jehan,” Archambault said; “but give
me a chair, I am marvellously short of breath of late, and I hurried,
having something of weight to say.”
When he was seated he clasped his fat little hands on his knee and
waited placidly while his host lighted another taper and closed the
shutters on the street. When Péron sat down at last, his guest was
smiling and complacent, the same round little man who for forty
years had catered for and flattered the wealthy coterie of the Marais,
and was one of the most famous cooks of Paris. It was said, in the
next reign, that Vatel learned his trade from him, as he had learned
it of Zamet. His dress was far richer than the young nobleman’s.
Péron wore the uniform of monsignor’s guards; the cook wore a suit
of black velvet with ruffles of Flemish lace, a chain of gold around
his neck, buckles that were gemmed with jewels at his knees and on
his shoes. He cast a glance not unseasoned with pity at the bare
room.
“Mon Dieu!” he said, “what a place for a marquis.”
The exclamation was so genuine and involuntary that Péron laughed
outright.
“My tastes are more simple than yours, Archambault,” he said.
The pastry cook shrugged his shoulders.
“It makes my heart ache, M. Jehan,” he replied heartily, “for I
remember who you are and what is your due. But ’tis the vulgar who
gain nowadays; monsignor has no love for the grandees. However,
that is not here nor there; I came for another matter. You have lost a
ring?”
Péron looked at him in amazement.
“By St. Denis!” he said, “there is witchcraft in it. Yes, I have lost a
ring. What more?”
Archambault looked at him placidly, his round eyes showing neither
amazement nor curiosity.
“The ring is in the hands of M. de Nançay,” he said calmly.
Péron rose from his chair with a sharp exclamation.
“I fear I am ruined!” he cried; “tell me all you know, Archambault.”
The pastry cook rubbed his hands together with a certain unctuous
enjoyment of the situation.
“They were at my shop,” he said, with a deliberation that tormented
his auditor; “M. de Nançay, M. de Vesson, and another, a relative, I
take it, of M. de Bouillon. They had a private room, and—” he
stopped, looking a little abashed under Péron’s searching eyes.
“Well, monsieur,” he went on with a shrug, “what would you? I have
found it useful to keep an eye on my guests; I have known many
things. In that same room I heard the challenge discussed of the
famous duel on the Place Royale, for which M. de Bouteville and M.
de Chapelles suffered,—monsignor’s example to enforce his edict. I
—”
“Ciel, Archambault, go on!” cried Péron in despair.
“I am going on,” the pastry cook replied aggrieved. “I have a peep-
hole—un œil-de-bœuf—concealed in the partition, you understand,
M. Jehan, and there I overheard the story of the cardinal’s ring.
They sent a man into your rooms here through some window—” the
narrator stopped again to look for it—“Ah, bah! do you not see that
roof? He found the ring in your coat and they have it. There is
mischief brewing; they would ruin you with the cardinal,—for I think
they suspect your identity,—and they would ruin the cardinal’s
schemes. They start to-morrow with that ring for Brussels; doubtless
you know more of what they can do with it than I do.”
He stopped, gazing at Péron eager for enlightenment, but he
received none. His host was on his feet in a moment looking at
sword and pistols and gathering some necessaries together.
Archambault looked on in aggrieved amazement; he had that natural
love for gossip that belongs to his class and character.
“What will you do, M. Jehan?” he asked blankly.
“If they go to Brussels to-morrow I go to-night,” Péron replied
decisively; “and look you, Archambault, I will give you a letter to
Père Antoine, he must go for me to monsignor; I cannot lose an
hour, nay, not a minute.”
“You cannot go alone!” Archambault cried, with agitation. “Mère de
Dieu! there will be four or six of them—you are mad.”
“So much the better—one can more easily outstrip four or six in a
race for Flanders,” Péron replied, changing his uniform for a dark suit
and a hallecrèt, while he talked.
“Ah, I see, you would be first in Brussels,” Archambault exclaimed;
“but it will not do—one man cannot outwit them.”
He fell into meditation, sitting cross-legged on the high wooden
stool; with all his flippancy and selfish greed, the pastry cook had
still something of manhood left, and no little wit of a low order but
keen enough to serve his ends.
“I have it,” he said, looking up and waving his hands. “Choin is at my
place, a little tipsy, I believe, but in the morning he will be on his
feet. The great hulk was asleep on the kitchen floor, and but for my
haste to come here I would have had him thrown into monsignor’s
gardens to cool; but, parbleu! he is the very man.”
“The man, if sober,” Péron replied, smiling, “but drunk—he is as
useless as the figures on Maître Jacques’s great jacquemart!”
“He will be sober in the morning, and so will Matthieu and Jeannot,”
said the pastry cook; “by your leave, therefore, M. Jehan, I will send
them after you post-haste.”
“A useless trouble, good Archambault,” Péron replied, picking up his
cloak and sword, being now fully equipped for his journey; “they
would scarcely overtake me, and would doubtless get into a drunken
brawl by the way.”
The cook shook his head. “Nay,” he said, “I have noticed that Choin
does not drink when he has work; you used him before, and you
may use him again. I can send him at daybreak, for I will set my
fellows to work upon him with cold water enough to drown the fires
out of his brain and belly.”
Péron was not untouched by the honest man’s anxiety.
“I thank you, friend,” he said, shaking the other’s hand, “but it is
useless; I can make shift with a good horse to outstrip these plotters
on the road, and I am off at once. There is the letter for Père
Antoine; and for the cake—why, keep it against my return.”
“Which road do you take, M. Jehan?” persisted the pastry cook, as
they went down the narrow stairs together.
“By the way of Amiens, though I shall avoid the town,” Péron
replied; “but I shall cross the Somme at the Blanche Tache.”
No more was said; Péron believed that he had discouraged the
cook’s well-meant scheme, and hastened to the stables for his horse,
knowing well that every hour counted and that he must reach
Brussels before the conspirators, or all would be lost. The stable-
boys were asleep and he saddled and bridled his own horse, thinking
once or twice that he heard something stir in the straw in the next
stall, but putting it down to the credit of the rats.
It had been an eventful evening; at nightfall mademoiselle came to
warn him, later Archambault told his story, and at midnight he was
riding along the Rue St. Denis on his way to Flanders. His future,
and perhaps his life, depended upon the four feet of his horse and
his own wit. In spite of the stirring occurrences of the last few
weeks, in spite of his disappointment at the tidings of
mademoiselle’s betrothal, he was calm and alert as he went out on
his dangerous and uncertain errand. He not only wished to save his
own honor, but he believed that there was peril to France in the
plotting of these conspirators. He knew that on a little thing hangs
sometimes the fate of an empire, and he understood something of
the web that the cardinal was ever weaving with the patience and
the skill of a spider. Yet with all these reflections, with the weight of
this anxiety upon him, he longed greatly to settle an account with M.
de Bièvre, and the face of mademoiselle haunted him. He thought
with a smile, however, of the party waiting with fruitless patience at
the stone bridge of the Cours la Reine.
CHAPTER XXVI
IN THE FOREST OF CHANTILLY

IT was one o’clock when Péron rode through St. Denis, and a light
spring rain was falling; through the mist he saw the blurred lights of
the guardhouse and he heard the tolling of the abbey bell. It was
dreary enough, and so were his meditations; at the very moment
when he seemed to have succeeded, misfortune again assailed him.
He had staked his honor and his life upon the mission to Brussels,
and he had executed it only to lose all that he had gained by this
last trick of fate. It seemed as if peril, conspiracy, and murder had
tracked his footsteps ever since the night when good Madame Michel
had held him in her arms in the woods of Nançay, praying and
weeping by turns over the bereaved infant. His peaceful childhood
on the Rue de la Ferronnerie, the happiness of his boyhood with
Condé, were after all but intervals in the drama of his eventful life.
The hour, the rain, the lonely road, all depressed his usually buoyant
spirits and chilled his blood; he recalled a story which Jacques des
Horloges was fond of reciting—of a noble family in which every male
died a violent death. It required an effort to shake off his lethargy, to
direct his attention to his horse, which stumbled more than once in
the mire, and to concentrate his mind upon his errand. If
Archambault’s story was true, he had seven or eight hours the start
of the conspirators, and it would go hard with him if he did not
defeat them; in any event, there was a hope left, and that a strong
one, that Père Matthieu would never be outwitted.
With all this, fate beset Péron on every side. He had been willing to
sacrifice himself for Renée de Nançay, to endure an injustice rather
than crush her with the shame of her father’s villainy, but was he
prepared to do the same for Madame de Bièvre? And why not? Had
he ever dreamed of wedding mademoiselle? Surely not; to wed her
he must proclaim his rank; and if he proclaimed it, they would be
separated forever. Then, he argued, if he could not marry her,
doubtless she would have married in any case, and why should he
find it hard to shield her as a wife? Ah, but he did! The difference
was there, and sharp enough to make him wince.
In the midst of these reflections there came a more common-place
anxiety. His horse stumbled again and went lame. He had saddled
the beast in the dark, without making any examination of him, and
he now realized his error; for if anything went wrong with the horse,
he would meet with disastrous delays. He dismounted and tried to
discover the trouble, but in vain; he was without means of making a
light, and could not see. There was no alternative therefore but to
resume his seat in the saddle and go on with caution until daybreak;
but he no longer dared to keep up the pace at which he had started,
no matter how much he chafed under the delay. To change horses
on the road was no part of his design, especially since the horse left
behind would prove an excellent clew by which he could be tracked.
This compelled him to spare the animal, and he was further impeded
by the soft condition of the roads, still muddy from the heavy
weather; so he made but poor progress, and was still a league from
Chantilly when the black rain-clouds lifted in the east showing a
keen line of silver, like the edge of a naked sword, where dawn cut
the night in twain. Before him the woods of Chantilly took fantastic
shapes through the mist, and around him the meadows were
undulated like the gray billows of the ocean. The estate of Chantilly,
once the property of the house of Montmorency, had been forfeited
by the rebellion of the last unfortunate duke and was now in the
hands of the Princesse de Condé, a gift from the king.
As soon as the light was sufficient, Péron found that his horse was
suffering from a loose shoe on one of his forefeet, and that the
animal must be attended to before he could proceed on his journey
to Flanders. This made it imperative for him to stop at the town in
search of a smith, much against his own wishes; for he would be
readily recognized if he came across any of the retainers of Condé,
who were all more or less acquainted with the former protégé of the
prince. However, there was no help for it, and making the best of a
bad business he turned his horse’s head toward the spot where he
remembered that there used to be a smithy. He had no difficulty in
finding the forge, but there was no fire; and the blacksmith was
evidently asleep over his shop, for the place was quiet. Péron
knocked so loudly, however, that he finally succeeded in rousing the
inmates, and the smith came down with reluctance to answer his
summons, having no wish to go to work so early.
“No horses will be shod here for two good hours,” he said bluntly,
eying his visitor from head to foot with a scowl of disapproval.
He was a big, brawny fellow; a Gascon from his tongue, and the
smut on his face added to his natural ugliness; but Péron
remembered him as a not ill-natured retainer of Condé. A delay of
two hours would be fatal to the musketeer’s interests, and he did
not hesitate to use every argument at his command.
“Do you not know me, Ferré?” he said; “you taught me once to shoe
a horse, and it was from you that I first learned to strike a straight
blow from the shoulder.”
“Pardieu, ’tis monseigneur’s boy!” exclaimed the smith, with a
change of expression. “I did not know you, Péron, in your black
cloak, and with the air you have of a great gentleman. So, ’tis you
that cannot shoe your horse? You have forgotten some useful
lessons, and I am minded to let you wait for your pains; I have had
no breakfast, and I am not the man to work on an empty stomach.”
“Yet do me this favor, good Ferré, for old times’ sake,” Péron urged;
“I am bound on a pressing errand, and if I delay there may be bad
results—for me.”
The smith still hesitated, looking from the musketeer to his horse.
“Leave the beast with me,” he said gruffly, “and get a new horse at
the inn; you dress like a man with a purse.”
“But it does not suit me to change horses,” Péron replied; “and
though I am not the rich man you take me for, I will pay well for this
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!

ebookmass.com

You might also like