文档介绍:This page intentionally left blank
Data Analysis and Graphics
Using R – an Example-Based Approach
Third Edition
John Maindonald
Mathematical Sciences Institute, Australian National University
and
W. John Braun
Department of Statistical and Actuarial Sciences, University of Western Ontario
CAMBRIDGE UNIVERSITY PRESS
Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore,
São Paulo, Delhi, Dubai, Tokyo
Cambridge University Press
The Edinburgh Building, Cambridge CB2 8RU, UK
Published in the United States of America by Cambridge University Press, New York
Information on this title: 0521762939
© Cambridge University Press 2003
Second and third editions © John Maindonald and W. John Braun 2007, 2010
This publication is in copyright. Subject to statutory exception and to the
provision of relevant collective licensing agreements, no reproduction of any part
may take place without the written permission of Cambridge University Press.
First published in print format 2010
ISBN-13 978-0-511-71286-9 eBook (NetLibrary)
ISBN-13 978-0-521-76293-9 Hardback
Cambridge University Press has no responsibility for the persistence or accuracy
of urls for external or third-party websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
For Edward, Amelia and Luke
also Shireen, Peter, Lorraine, Evan and Winifred
For Susan, Matthew and Phillip
Contents
Preface page xix
Content – how the chapters fit together xxv
1 A brief introduction to R 1
An overview of R 1
A short R session 1
The uses of R 6
Online help 7
Input of data from a file 8
R packages 9
Further steps in learning R 9
Vectors, factors, and univariate time series 10
Vectors 10
Concatenation – joining vector objects 10
The use of relational operators pare vector elements 11
The use of squa