| |
| |
Preface | |
| |
| |
Author | |
| |
| |
| |
Introduction: Getting Started with R | |
| |
| |
R Tutorial | |
| |
| |
Vectors | |
| |
| |
Graphs | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
References | |
| |
| |
| |
R Scripts | |
| |
| |
Creating and Saving an R Script | |
| |
| |
Running an R Script | |
| |
| |
Finding Errors in an R Script | |
| |
| |
Sharpening Up Your Scripts with Comments | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Reference | |
| |
| |
| |
Functions | |
| |
| |
Creating New Functions in R | |
| |
| |
More about User-Defined R Functions | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
References | |
| |
| |
| |
Basic Graphs | |
| |
| |
Real-World Example | |
| |
| |
Graphs of One Variable | |
| |
| |
Stripchart | |
| |
| |
Histogram | |
| |
| |
Stem-and-Leaf Plot | |
| |
| |
Boxplot | |
| |
| |
Timeplot | |
| |
| |
Graphs of Two Variables | |
| |
| |
Scatterplot | |
| |
| |
Side-by-Side Boxplots | |
| |
| |
Bar Graphs and Pie Charts | |
| |
| |
Bar Graphs and Pie Charts Using Data | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
| |
Data Input and Output | |
| |
| |
Data Frames in R | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
| |
Loops | |
| |
| |
Writing a "For-Loop" | |
| |
| |
Checking the Loop | |
| |
| |
OK, Mr. Fibonacci…So What? | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
References | |
| |
| |
| |
Logic and Control | |
| |
| |
Logical Comparison Operators and Logical Vectors | |
| |
| |
Boolean Operations | |
| |
| |
Missing Data | |
| |
| |
More about Indexes | |
| |
| |
Conditional Statements | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
Reference | |
| |
| |
| |
Quadratic Functions | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
References | |
| |
| |
| |
Trigonometric Functions | |
| |
| |
Right Triangles | |
| |
| |
Trigonometric Functions | |
| |
| |
Right Triangles, Circles, and Radians | |
| |
| |
Properties of Trigonometric Functions | |
| |
| |
Polar Coordinates | |
| |
| |
Real-World Examples | |
| |
| |
Distances to Stars Near the Solar System | |
| |
| |
Projectile Motion | |
| |
| |
Planetary Orbits | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
| |
Exponential and Logarithmic Functions | |
| |
| |
Achieving Real Power | |
| |
| |
The Special Number | |
| |
| |
The Number e in Applications | |
| |
| |
The Exponential Function | |
| |
| |
Exponential Growth | |
| |
| |
Logarithmic Functions | |
| |
| |
Logarithmic Scales | |
| |
| |
Richter Scale | |
| |
| |
The pH Scale | |
| |
| |
Star Magnitude | |
| |
| |
Real-World Examples | |
| |
| |
Radioactive Decay | |
| |
| |
Limit to Population Growth | |
| |
| |
Peak Oil | |
| |
| |
Final Remarks | |
| |
| |
Computational and Algebraic Challenges | |
| |
| |
References | |
| |
| |
| |
Matrix Arithmetic | |
| |
| |
Another Way to Multiply Vectors | |
| |
| |
Matrix Multiplication | |
| |
| |
Matrix Addition and Subtraction | |
| |
| |
Reading a Data File into a Matrix | |
| |
| |
Real-World Example | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternote | |
| |
| |
References | |
| |
| |
| |
Systems of Linear Equations | |
| |
| |
Matrix Representation | |
| |
| |
Matrix Inverse | |
| |
| |
Inverse Matrices and System Solutions in R | |
| |
| |
Real-World Examples | |
| |
| |
Old Faithful | |
| |
| |
A Galaxy Not So Far Away | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
References | |
| |
| |
| |
Advanced Graphs | |
| |
| |
Two-Dimensional Plots | |
| |
| |
Options for Styles of Symbols, Lines, Axes | |
| |
| |
Data Symbol Types | |
| |
| |
Connecting Line Types | |
| |
| |
Plot Types | |
| |
| |
Axis Limits | |
| |
| |
Tic Marks | |
| |
| |
Axis Labels | |
| |
| |
Suppressing Axes | |
| |
| |
Sizes of Symbols, Labels, Widths of Lines, Axes | |
| |
| |
Other Customizations | |
| |
| |
Adding Points | |
| |
| |
Adding Lines | |
| |
| |
Adding Text | |
| |
| |
Titles and Subtitles | |
| |
| |
Legends | |
| |
| |
New Graph Windows | |
| |
| |
Global and Local | |
| |
| |
Multiple Panels | |
| |
| |
Scatterplot Matrices | |
| |
| |
Three-Dimensional Plots | |
| |
| |
Color | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Reference | |
| |
| |
| |
Probability and Simulation | |
| |
| |
Random Variables | |
| |
| |
Probability | |
| |
| |
Probability Distributions of Counts | |
| |
| |
Binomial Distribution | |
| |
| |
Probability Distributions of Measurements | |
| |
| |
Uniform Distribution | |
| |
| |
Normal Distribution | |
| |
| |
Real-World Example | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
References | |
| |
| |
| |
Fitting Models to Data | |
| |
| |
Fitting a Quadratic Model | |
| |
| |
Multiple Predictor Variables | |
| |
| |
Nonlinear Statistical Models | |
| |
| |
Final Remarks | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
References | |
| |
| |
| |
Conclusion-It Doesn't Take a Rocket Scientist | |
| |
| |
Real Solar System Example | |
| |
| |
The Problem | |
| |
| |
The Concept | |
| |
| |
Changes in Velocities | |
| |
| |
Move the Earth | |
| |
| |
Getting Organized | |
| |
| |
Outline of R Script for Calculating the Trajectory of Earth | |
| |
| |
The R Script | |
| |
| |
Computational Challenges | |
| |
| |
Afternotes | |
| |
| |
Calculus and Conic Sections | |
| |
| |
Feynman's Lost Lecture | |
| |
| |
Three-Body Problem | |
| |
| |
Neptune | |
| |
| |
Propagation of Error | |
| |
| |
Apophis | |
| |
| |
Orbit of Pluto Is Chaos | |
| |
| |
The ms Cancel | |
| |
| |
Mercury Orbit Precession, and General Relativity | |
| |
| |
Measurement Units | |
| |
| |
References | |
| |
| |
| |
Installing R | |
| |
| |
| |
Getting Help | |
| |
| |
| |
Common R Expressions | |
| |
| |
Index | |