Contents

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

images Part 1: R Basics

images Chapter 1: Downloading R and Setting Up a File System

Downloading R

Windows

OS X

Linux

Installing and Updating Packages

Windows

OS X

Updating R

Windows

OS X

Using R in Separate Folders

Windows

OS X

Linux

images Chapter 2: The R Prompt

The Three Parts of R: Objects, Operators, and Assignments

The R Prompt

An Example of a Calculation

images Chapter 3: Assignments and Operators

Types of Assignment

Example of Three Types of Assignment

The ls() and rm() Functions

Operators

Logical Operators and Functions

Arithmetic Operators

Matrix Operators and Functions

Relational Operators

Subscripting Operators

Odds and Ends

images Part 2: Kinds of Objects

images Chapter 4: Modes of Objects

Overview of the Modes

Commonly Used Modes

Atomic, Recursive, and Language Modes

Some Functions for Atomic Modes

The NULL Mode

The Logical Mode

The Numeric Mode

The Complex Mode

The Raw Mode

The Character Mode

The Common Recursive and Language Modes

The List Mode

The Function Mode

The Call Mode

The Name Mode

The Expression Mode

The S4 Mode

images Chapter 5: Classes of Objects

Some Basics on Classes

Vectors

Some Common Classes

The Matrix Class: matrix

The Array Class: array

The Time Series Classes: ts and mts

The Factor Classes: factor and ordered

The Data Frame Class: data.frame

The Date and Time Classes: Date, POSIXct, POSIXlt, and difftime

Names for Vectors, Matrices, Arrays, and Lists

images Part 3: Functions

images Chapter 6: Packaged Functions

The Libraries

Default Packages and Primitive Functions

Using the Help Pages

Title

Description

Usage

Arguments

Details

Value

Some Other Optional Sections

References

See Also

Examples

images Chapter 7: User-Created Functions

The Structure of a Function

How to Enter a Function into R

Using an Editor

Inline Entry

An Outside Editor: dget() and Copying and Pasting

images Chapter 8: How to Use a Function

Calling a Function

Arguments

The Output from a Function

images Part 4: Inputting and Creating Data, Outputting Data and Output, and Manipulating Objects

images Chapter 9: Importing and Creating Data

Reading Data into R, Including R Data Sets

The Function scan()

The Functions read.table(), read.csv(), and read.delim()

R Data Sets

Other Functions to Import Files

Probability Distributions and the Function sample()

Probability Distributions

The Function sample()

Manually Entering Data and Generating Data with Patterns

The Function c()

The Functions seq() and rep()

Combinatorics and Grid Expansion

The Function Paste

images Chapter 10: Exporting from R

The Function dump()

The Function sink()

The Function write()

The Function write.matrix()

The Functions write.table() and write.csv()

The Function dput()

Other Exporting Functions

images Chapter 11: Descriptive Functions and Manipulating Objects

Descriptive Functions

The Function dim()

The Functions nrow(), ncol(), NROW(), and NCOL()

The Function length()

The Function nchar()

Manipulating Objects

The Functions cbind() and rbind()

The Apply Functions

The sweep() and scale() Functions

The Functions aggregate(), table(), tabulate(), and ftable()

images Part 5: Flow Control

images Chapter 12: Flow Control

Brackets “{}” and the Semicolon “;”

The “if” and “if/else” Control Statements

The “while” Control Statement

The “for” Control Statement

The “repeat” Control Statement

The Statements “break” and “next”

Nesting

images Chapter 13: Examples of Flow Control

Nested ‘for’ Loops with an ‘if/else’ Statement

Using Indices

A ‘while’ Loop

Using Indices

Nested ‘for’ Loops

Using Indices

A ‘for’ Loop, ‘if’ Statement, and ‘next’ Statement

Using Indices

A ‘for’ Loop, a ‘repeat’ Loop, an ‘if’ Statement, and a ‘break’ Statement

Using Indices

images Chapter 14: The Functions ifelse() and switch()

The Function ifelse()

The Function switch()

images Part 6: Some Common Functions, Packages, and Techniques

images Chapter 15: Some Common Functions

The Function options()

The Functions round(), signif(), and noquote()

The Function round()

The Function signif()

The Function noquote()

The Function cat()

The Functions format(), print(), plot(), and summary()

The Function format()

The Function print()

The Function plot()

The Function summary()

Some Functions for Models: anova(), coef(), effects(), residuals(), fitted(), vcov(), confint(), and predict()

images Chapter 16: The Packages base, stats, and graphics

The base Package

Reserved Words

Built-In Constants

Trigonometric and Hyperbolic Functions

Beta- and Gamma-Related Functions

Miscellaneous Mathematical Functions

Complex Numbers

Matrices, Arrays, and Data Frames

A Few Other Functions and Some Comments

The stats Package

Basic Descriptive Statistics

 Some Functions That Do Tests

Some Modeling Functions in stats

Clustering Algorithms and Other Multivariate Techniques

The graphics Package

images Chapter 17: Tricks of the Trade

Value Substitution: NA, NaN, Inf, and -Inf

If Statements and Logical Vectors

Lists and the Functions list() and c()

Getting Data out of Functions

Recursive Functions

Some Final Comments

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.237.29