R Quick Syntax Reference - Margot Tollefson.pdf
(
2693 KB
)
Pobierz
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author ..............................................................................
xv
About the Technical Reviewer ........................................................
xvii
Acknowledgments ..........................................................................
xix
Introduction ....................................................................................
xxi
Part 1: R Basics ..............................................................
1
Chapter 1: Downloading R and Setting Up a File System ...............
3
Chapter 2: The R Prompt ................................................................
9
Chapter 3: Assignments and Operators ........................................
11
Part 2: Kinds of Objects ................................................
23
Chapter 4: Modes of Objects .........................................................
25
Chapter 5: Classes of Objects .......................................................
37
Part 3: Functions ..........................................................
57
Chapter 6: Packaged Functions ....................................................
59
Chapter 7: User-Created Functions...............................................
65
Chapter 8: How to Use a Function ................................................
71
v
CONTENTS AT A GLANCE
Part 4: Inputting and Creating Data, Outputting Data
and Output, and Manipulating Objects .........................
77
Chapter 9: Importing and Creating Data .......................................
79
Chapter 10: Exporting from R .......................................................
95
Chapter 11: Descriptive Functions and Manipulating Objects....
105
Part 5: Flow Control ....................................................
127
Chapter 12: Flow Control ............................................................
129
Chapter 13: Examples of Flow Control .......................................
133
Chapter 14: The Functions ifelse( ) and switch( ) ........................
145
Part 6: Some Common Functions, Packages, and
Techniques ...................................................................
151
Chapter 15: Some Common Functions ........................................
153
Chapter 16: The Packages base, stats, and graphics .................
163
Chapter 17: Tricks of the Trade...................................................
189
Index ..............................................................................................
197
vi
Introduction
R is a programming language that provides the user with powerful data and graphical
analysis options. R is both
flexible
and broad. From tasks as simple as adding two
numbers to tasks as complex as
fitting
an ARIMA model, R is capable of crunching the
numbers.
The
purpose of
R Quick Syntax Reference
is to provide the reader with the basic
syntax of R. Often an R user gets stuck if, for example, a mode is incorrect or a logical
test does not work. Because the full spectrum of R packages uses the same fairly simple
syntax,
R Quick Syntax Reference
provides the reader with the necessary information to
get unstuck and run and create all R functions and code.
The
R language is based on the language S, a high-level programming language
developed mainly by Richard A. Becker, John M. Chambers, and Allan R. Wilks in the
AT&T laboratories in 1975.
The
R version of the language
first
became available in 1993
and was developed by Ross Ihaka and Robert Gentleman at the University of Auckland,
New Zealand.
R is open source and is a GNU project. As open-source code, the R language is
free and constantly being improved.
The
R Development Core Team currently does the
development. Packages for specific analysis techniques are added often. At the present
time, there are 4,986 packages available in R. Most users will use only a few packages.
Although GUI versions of R are available, we discuss using R at the command prompt in
R Quick Syntax Reference.
This
book is about the S3 version of R—S3 standing for the third version of S, the
commercial program on which R is based.
The
developers of R have a new version,
S4—the fourth version of S—running concurrently with S3. Even though version S4 is
quite different from S3, it is necessary to know the syntax of S3 in order to use S4. And S3
remains a powerful,
flexible
language in its own right—hence, this book.
Part I covers the basics of R. Chapter 1 describes how to download and install R for
the Windows, Mac, and Linux operating systems and also how to download packages.
Because keeping separate folders for different projects is very useful, Chapter 1 gives
instructions for running R from different folders. It also gives the methods for updating
the R program itself.
Chapter 2 introduces the R prompt, gives a sample calculation, and describes the
three parts of R—objects, operators, and assignments. Chapter 3 covers the assignment
of names to objects, demonstrates the
ls()
function that allows you to see the objects in a
folder, and discusses the operators in R.
Part II describes R objects. Objects have modes, classes, and types. Chapter 4 lists the
modes and describes some of them. It also shows how modes and types differ. Chapter 5
discusses some of the classes.
xxi
Plik z chomika:
jonedave3
Inne pliki z tego folderu:
R&B Fake Book - Hal Leonard Corp.epub
(161322 KB)
R for Data Science - Hadley Wickham, Garrett Grolemu.pdf
(33032 KB)
R for Data Science - Hadley Wickham.epub
(31441 KB)
r-pvs12.pdf
(45020 KB)
R Graphics Cookbook - Winston Chang.pdf
(28041 KB)
Inne foldery tego chomika:
@other-lang
@packed
0
1
2-1
Zgłoś jeśli
naruszono regulamin