Conquer the complexities of this open source statistical
language
R is fast becoming the de facto standard for statistical
computing and analysis in science, business, engineering, and
related fields. This book examines this complex language using
simple statistical examples, showing how R operates in a
user-friendly context. Both students and workers in fields that
require extensive statistical analysis will find this book helpful
as they learn to use R for simple summary statistics, hypothesis
testing, creating graphs, regression, and much more. It covers
formula notation, complex statistics, manipulating data and
extracting components, and rudimentary programming.
* R, the open source statistical language increasingly used to
handle statistics and produces publication-quality graphs, is
notoriously complex
* This book makes R easier to understand through the use of
simple statistical examples, teaching the necessary elements in the
context in which R is actually used
* Covers getting started with R and using it for simple summary
statistics, hypothesis testing, and graphs
* Shows how to use R for formula notation, complex statistics,
manipulating data, extracting components, and regression
* Provides beginning programming instruction for those who want
to write their own scripts
Beginning R offers anyone who needs to perform
statistical analysis the information necessary to use R with
confidence.
Autorentext
Dr. Mark Gardener is an ecologist, lecturer, and writer working in the UK. He is currently self-employed and runs courses in ecology, data analysis, and R for a variety of organizations.
Zusammenfassung
Conquer the complexities of this open source statistical language
R is fast becoming the de facto standard for statistical computing and analysis in science, business, engineering, and related fields. This book examines this complex language using simple statistical examples, showing how R operates in a user-friendly context. Both students and workers in fields that require extensive statistical analysis will find this book helpful as they learn to use R for simple summary statistics, hypothesis testing, creating graphs, regression, and much more. It covers formula notation, complex statistics, manipulating data and extracting components, and rudimentary programming.
- R, the open source statistical language increasingly used to handle statistics and produces publication-quality graphs, is notoriously complex
- This book makes R easier to understand through the use of simple statistical examples, teaching the necessary elements in the context in which R is actually used
- Covers getting started with R and using it for simple summary statistics, hypothesis testing, and graphs
- Shows how to use R for formula notation, complex statistics, manipulating data, extracting components, and regression
- Provides beginning programming instruction for those who want to write their own scripts
Beginning R offers anyone who needs to perform statistical analysis the information necessary to use R with confidence.
Inhalt
Introduction xxi
Chapter 1: Introducing R: What It Is and How to Get It 1
Getting the Hang of R 2
The R Website 3
Downloading and Installing R from CRAN 3
Installing R on Your Windows Computer 4
Installing R on Your Macintosh Computer 7
Installing R on Your Linux Computer 7
Running the R Program 8
Finding Your Way with R 10
Getting Help via the CRAN Website and the Internet 10
The Help Command in R 10
Help for Windows Users 11
Help for Macintosh Users 11
Help for Linux Users 13
Help For All Users 13
Anatomy of a Help Item in R 14
Command Packages 16
Standard Command Packages 16
What Extra Packages Can Do for You 16
How to Get Extra Packages of R Commands 18
How to Install Extra Packages for Windows Users 18
How to Install Extra Packages for Macintosh Users 18
How to Install Extra Packages for Linux Users 19
Running and Manipulating Packages 20
Loading Packages 21
Windows-Specific Package Commands 21
Macintosh-Specific Package Commands 21
Removing or Unloading Packages 22
Summary 22
Chapter 2: Starting Out: Becoming Familiar with R 25
Some Simple Math 26
Use R Like a Calculator 26
Storing the Results of Calculations 29
Reading and Getting Data into R 30
Using the combine Command for Making Data 30
Entering Numerical Items as Data 30
Entering Text Items as Data 31
Using the scan Command for Making Data 32
Entering Text as Data 33
Using the Clipboard to Make Data 33
Reading a File of Data from a Disk 35
Reading Bigger Data Files 37
The read.csv() Command 37
Alternative Commands for Reading Data in R 39
Missing Values in Data Files 40
Viewing Named Objects 41
Viewing Previously Loaded Named-Objects 42
Viewing All Objects 42
Viewing Only Matching Names 42
Removing Objects from R 44
Types of Data Items 45
Number Data 45
Text Items 45
Converting Between Number and Text Data 46
The Structure of Data Items 47
Vector Items 48
Data Frames 48
Matrix Objects 49
List Objects 49
Examining Data Structure 49
Working with History Commands 51
Using History Files 52
Viewing the Previous Command History 52
Saving and Recalling Lists of Commands 52
Alternative History Commands in Macintosh OS 52
Editing History Files 53
Saving Your Work in R 54
Saving the Workspace on Exit 54
Saving Data Files to Disk 54
Save Named Objects 54
Save Everything 55
Reading Data Files from Disk 56
Saving Data to Disk as Text Files 57
Writing Vector Objects to Disk 58
Writing Matrix and Data Frame Objects to Disk 58
Writing List Objects to Disk 59
Converting List Objects to Data Frames 60
Summary 61
Chapter 3: Starting Out: Working With Objects 65
Manipulating Objects 65
Manipulating Vectors 66
Selecting and Displaying Parts of a Vector 66
Sorting and Rearranging a Vector 68
Returning Logical Values from a Vector 70
Manipulating Matrix and Data Frames 70
Selecting and Displaying Parts of a Matrix or Data Frame 71
Sorting and Rearranging a Matrix or Data Frame 74
Manipulating Lists 76
Viewing Objects within Objects 77
Looking Inside Complicated Data Objects 77
Opening Complicated Data Objects 78
Quick Looks at Complicated Data Objects 80
Viewing and Setting Names 82
Rotating Data Tables 86
Constructing Data Objects 86
<...