ebook img

The New S Language : a programming environment for data analysis and graphics PDF

721 Pages·2018·124.433 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview The New S Language : a programming environment for data analysis and graphics

tt~ The" S Language A PROGRAMMING ENVIRONMENT FOR DATA ANALYSIS AND GRAPHICS tteN The SL anguage 1\ A PROGRAMMING ENVIRONMENT FOR DATA ANALYSIS AND GRAPHICS Richard A. Becker John M. Chambers Allan R. Wilks AT&T Bell Laboratories CHAPMAN & HALL/CRC Boca Raton London New York CRC Press is an imprint of the Boca Raton LTaoylnord &o Fnra ncNis eGwro uYp,o arnk in foWrmaa sbhuisinnegstson, D.C. First published 1988 by CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 Reissued 2018 by CRC Press © 1988 by Bell Telephone Laboratories Ind. CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Becker, Richard A The new S language Bibliography: p. Includes index. ISBN 0-412-74150-4 1. S (Computer program language). I. Chambers, John M. II. Wilks, Allan Reeve. III. Title. QA76.73.S15B43 1988 519.5’028’55133—dc20 88-5656 A Library of Congress record exists under LC control number: 88005656 Publisher’s Note The publisher has gone to great lengths to ensure the quality of this reprint but points out that some imperfections in the original copies may be apparent. Disclaimer The publisher has made every effort to trace copyright holders and welcomes correspondence from those they have been unable to contact. ISBN 13: 978-1-315-89588-8 (hbk) ISBN 13: 978-1-351-07498-8 (ebk) Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com To Eloise, Bea, and Fiona Preface S is a language and an interactive programming environment for data analysis and graphics. The S language is a very high-level language for specifying computations. The language is part of an interactive environment: S encourages you to compute, look at data, and program interactively, with quick feedback to enable you to learn and understand. The primary goal of the S environment is to enable and encourage good data analysis. The facilities in S are directed toward this goal. • S is about data: it provides general and easy-to-use facilities for organ izing, storing, and retrieving all sorts of data. • S is about analysis: that is, computations you need to understand and use data. S provides numerical methods and other computational tech niques. • S is about programming: you can write functions in the S language itself. These functions can build on the power and simplicity of the S language. Because S is highly interactive, new functions can be designed and tried out much faster than with most languages. S also provides simple interfaces to other kinds of computing, such as to com mands from the UNIX system or to C or Fortran routines. • Especially, S is about graphics: interactive, informative, flexible ways of looking at data. The graphics capabilities of S are designed to encourage you to create new tools and try out new ideas. A wide range of people are presently using S in diverse areas-financial analysis, statistics research, management, academia-for analytical computing, graphics, and data analysis. Join them and learn the power of working with S. vii viii Preface How to Read This Book This book describes the S language and environment. When you read it, we recommend combining reading with doing. Have a computer terminal handy, preferably with graphics, and start S running. Read a little, then try out some of the examples or exercises, and experiment with variations or with your own data. A good way to review or supplement the discussion of a particular S function, say plot, is to look at the on-line documentation by typing > help(plot) In particular, whenever the book suggests looking up something in Appendix 1, you can use the on-line documentation instead. We have tried to organize the book to facilitate self-teaching. Most chapters contain exercises that review and sometimes extend the material. Answers to many of the exercises appear at the end of the chapter. As you read through the book, you may notice a gradual transition. Early chapters focus on using S informally for your own analysis. Later on, the emphasis shifts to more ambitious use of S as a programming environment for applications. This shift reflects the experience of many S users, who find that S leads them gently into the world of software design. The book begins with three introductory chapters that should be helpful to all users: a case study that shows S without trying to explain it; a tutorial chapter covering material in an informal way; and a more formal treatment of the basic techniques in the language. You should be able to get through this material with a few hours of work. At this point, you will be able to use S productively. The next three chapters introduce many more capabilities and help you understand the philosophy behind S. Chapter 4 gives an introduction to graph ics within S, ranging from high-level plotting commands to detailed control of plots. The emphasis is on analytical displays: those that are valuable during data analysis. Chapter 5 describes data in S, explaining how S organizes matrices, arrays, and other kinds of data and introducing techniques to help you organize data for your applications. Chapter 6 discusses how to write S func tions, including editing, debugging, and using the interface to the UNIX system. When you have finished the first six chapters, you should be able to create new facilities in S and use it creatively in your data analysis. Chapters 7 and 8 provide advanced material that will be of interest if you intend to develop applications within S that will be used by others. Func tion writing is the topic of chapter 7; it introduces the interface to C and For tran plus powerful techniques for controlling how S works and for symbolic computation. Chapter 8 ties together the organization of data with the design of functions; the combination of these ideas will often be the key to effective use of S in your own major applications. Preface ix Chapter 9 is for everyone. It brings together ideas from other chapters in the book, providing case studies and examples of using S for a variety of tasks, from data organization to solving numerical problems to a computer game. It also discusses matters of style and strategy in the use of S. It is a repository for important concepts, general ways of attacking problems, and advice on how best to use S. Advanced graphics material follows in chapter 10, which shows how to use the capabilities of S to implement new graphics functions. Chapter 11 gives a compact description of the syntax and semantics of the S language, and will be of most interest to those of you who want to know how S really works. Finally, we end with an annotated bibliography list ing some books that may be of interest to you as you use S. The narrative material ends midway through the book. Most of the remainder is devoted to detailed documentation of the S functions and datasets. Documentation for S functions is presented in Appendix 1. Appendix 2 describes the datasets that are available in the system data directory. The mate rial in Appendices 1 and 2 is also available on-line for the S user. Appendix 3 provides one-line descriptions of S functions, broken down by various topics. It can help you to find functions when you can't remember their names. Appendix 4 gives people who have used an earlier version of S a description of what has changed. An extensive index at the end of the book can be used for quick access to the places in the text where specific topics are discussed. The Software S is a software system that runs under the UNIX operating system on a variety of hardware configurations. S is designed to take advantage of other tools and languages provided by the operating system. As this book is being written, S runs on many different computers, from supermicros to large mainframe machines. Work is continually under way to implement S on new hardware. For information on obtaining source code for S, contact: AT&T Software Licensing Manager Room 3A36 10 Independence Blvd. Warren, NJ 07060-9824 (800) 462-8146 (908) 580-6355 Fax (908) 580-5388 International There are also a number of independent vendors selling binary-only versions of S. The binary versions are adapted to specific computers and, sometimes, to other operating systems. A list of the vendors is available from AT&T.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.