Wiley guidebook to r graphics using microsoft windows

272 226 0
Wiley guidebook to r graphics using microsoft windows

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Guidebook to R Graphics Using Microsoft® Windows Guidebook to R Graphics Using Microsoft® Windows Kunio Takezawa National Agricultural Research Center, National Agriculture and Food Research Organization Graduate School of Life and Environmental Sciences University ofTsukuba Ibaraki Tsukuba, Japan WILEY A JOHN WILEY & SONS, INC., PUBLICATION Copyright © 2012 by John Wiley & Sons, Inc All rights reserved Published by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada 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, scanning or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., I l l River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permission Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representation or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose No warranty may be created or extended by sales representatives or written sales materials The advice and strategies contained herein may not be suitable for your situation You should consult with a professional where appropriate Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002 Wiley also publishes its books in a variety of electronic formats Some content that appears in print, however, may not be available in electronic formats For more information about Wiley products, visit our web site at www.wiley.com Library of Congress Cataloging-in-Publication Data: Takezawa, Kunio, 1959— Guidebook to R graphics using Microsoft Windows / Kunio Takezawa p cm Includes index ISBN 978-1-118-02639-7 (pbk.) Computer graphics R (Computer program language) Microsoft Windows (Computer file) I Title T385.T346 2012 006.6'633—dc23 2011049806 Printed in the United States of America 10 CONTENTS Preface Acknowledgments Basic Graphics 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 Introduction Downloading and installation of R Start-up of R, and construction and execution of R programs Coordinate axes Points and straight lines Reuse of graphs produced by R Text Various points and straight lines Fonts Figures such as circles and rectangles Legends and logarithmic plots Bar charts Pie charts ix xiii 1 11 14 16 24 27 34 35 41 42 45 V Vi CONTENTS 1.14 1.15 Layout of multiple graphs Summary Exercises 46 60 62 Graphics for Statistical Analysis 65 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 Introduction Stem-and-leaf displays Histograms and probability density functions Strip chart Boxplots Multiple-axis layouts Display of confidence intervals Scatter plot matrices Radar charts and parallel charts Functions of one variable Functions of two variables Map graphs Histograms of two variables Time series graphs of two variables Implicit functions Probability density functions Differential values and values of integrals Summary Exercises Interactive R Programs 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 Introduction Positioning by mouse on a graphics window Inputting values on the console window to draw a graph Reading data from a data file Moving data on a natural spline Understanding simple regression Adjusting three-dimensional graphs Constructing polynomial regression equations interactively Understanding local linear regression Summary Exercises 65 66 67 73 75 80 91 93 95 97 100 108 113 116 119 121 124 132 133 139 139 140 143 156 158 166 175 180 183 188 190 CONTENTS Graphics Obtai ned Using Packages Based on R 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 Introduction Package "rimage" Package "gplots" Package "ggplot2" Package "scatterplot3d" Package "rgl" Package "misc3d" Package "aplpack" Package "vegan" Package "tripack" Package "ade4" Package "vioplot" Package "plotrix" Package "rworldmap" Exercises VÜ 193 193 194 195 200 203 207 221 232 234 236 238 241 243 247 249 Appendix 253 A.l A.2 A.3 253 254 254 Index Digital files Free software Data 257 PREFACE Carol Marcus: Let me show you something that will make you feel young as when the world was new (Star Trek: The Wrath of Khan (1982) http://www.imdb.com/title/tt0084726/quotes) Construction of appropriate graphs plays an important role in data analysis Pertinent graphs often reveal the conditional implications of data clearly even if the summarization of data by deriving a small number of values can show limited aspects of the characteristics of data In addition, persuasive graphs are an indispensable tool for the presentation of scientific papers, the description of commodities, patent applications, project proposals, lectures, training courses, business meetings, negotiations, legal actions, etc The graphical presentation of features of data and structures of concepts can strengthen arguments Therefore, it is well known that producing high-quality graphs is a requisite in diverse fields Demand for richly expressive graphs has grown Moreover, people's need for better graphs at a lower cost has increased markedly because the extraordinary development of computer technology has enabled the drawing of complicated graphs in a short period of time Therefore, drawing graphs using a PC is no longer a specialist skill that requires professional expertise It should be a fairly commonplace technique, comparable to the creation of simple documents using a word processor ix X PREFACE The free software "R" is now widely used for statistical calculation and graphics R is equipped with various functions for constructing graphs Moreover, installing software packages enables a wider range of graphs to be produced The importance of R as a tool for graphics has increased However, those unfamiliar with the use of R for statistical calculations tend to avoid the software because its wide range of functions may make it appear daunting In light of this situation, this book aims to demonstrate that producing graphs using R is an easy-to-master technique Hence, this book often does not describe R commands and their range of arguments exhaustively, but rather exemplifies typical methods for constructing graphs and their results This makes the book a guide that aims to foster a feeling of confidence that most graphs can be produced using R As is generally the case with learning word processing software, learners should obtain an overall picture of the graphical abilities of R in a short time by gaining familiarity with its main features rather than by acquiring details of each function; then they can realize a greater diversity of graphics by referring to references and articles on the Internet This way of learning is effective provided learners are not aspiring to careers as specialists in the software To achieve the aims of this book, procedures for excuting R are presented as R programs that contain a series of R commands That is, this book, unlike other books in this field, does not proceed with procedures by inputting R commands sequentially Batch processing is focused on rather than sequential processing (real-time processing) Sequential processing has the advantage of being able to construct graphics while seeing the graphs in progress However, batch processing is clearly superior to sequential processing because inappropriate manipulation and keystroke errors often occur during the work In batch processing, R programs (a series of R commands) are recorded regularly, making it easy to rerun a procedure after modifying the program In addition, learners can review R programs that they have learned, and use or develop them after accumulating techniques in the form of R programs Fortunately, if learners transform their R programs into text files, the programs can be easily found when needed by full-text searching For example, we assume that a folder called D: \GraphicsR contains RData (a work image file; this file stores R programs and data) When R programs are accumulated in RData, it will be useful for learners to search for R programs that they need among the programs in RData For this purpose, learners should activate RData and run the R program below, for instance functionO { obi d i s l

Ngày đăng: 18/04/2017, 10:32

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan