R Basic 101
1
Prologue
1.1
Thought Experiments
1.1.1
First Trial
1.1.2
Second Trial
1.1.3
Third Trial
1.2
Welcome to the R Language
2
Installation
2.1
R Installation
2.1.1
Windows
2.1.2
OS X (Mac)
2.1.3
Ubuntu
2.1.4
Update the R Installation
2.2
R Package Installation
2.2.1
From the Internet
2.2.2
From Local Source or Binary
3
CLI versus IDE
3.1
CLI (Command-Line Interface)
3.1.1
For Windows User
3.1.2
For OS X (Mac) User
3.1.3
For Linux User
3.2
IDE (Integrated Development Environment)
3.2.1
RStudio
3.2.2
RStudio Server
3.3
Interactive v.s. Batch Mode
3.3.1
Parsing Command Line Arguments
3.3.2
Interactive or Not Interactive?
3.3.3
Shabang
#!
4
Data Structures and Types
4.1
Atomic Vector
4.1.1
General Operations on Vectors
4.1.2
Factor
4.1.3
Matrix
4.1.4
Array
4.2
Recursive Vector
4.2.1
List
4.2.2
Data Frame
4.3
Special Values
4.3.1
NA
4.3.2
NaN
4.3.3
NULL
5
String Operations
5.1
Basics
5.1.1
paste
5.1.2
sprintf
5.1.3
cat
and
print
5.1.4
Miscellaneous
5.2
Regular Expressions
5.2.1
Filtering
5.2.2
Substitution
5.2.3
Extraction
5.2.4
The
stringr
Library
6
Control Flow
6.1
Conditioning
6.1.1
if
6.1.2
ifelse
6.1.3
Logical Operations
6.2
Loop
6.2.1
repeat
6.2.2
while
6.2.3
for
7
Function
7.1
User-Define Function
7.2
Arguemnts
7.2.1
Default Value
7.2.2
Lazy Evaluation
7.2.3
Ellipsis (
...
)
7.3
Anonymous Function (Lambda)
7.4
Lexical Scoping
7.5
Extraction Function
7.6
Replacement Function
8
R Language Characteristics
8.1
Help
8.2
Vectorization
8.3
Recycling
8.4
The
apply
Family
8.4.1
apply
8.4.2
lapply
and
sapply
9
Working Directory
9.1
Library Search Path
9.2
Save / Load
10
Data Processing
10.1
Tabular Data
10.1.1
Read
10.1.2
Write
10.1.3
Column-Oriented Computation
10.1.4
Row-Oriented Computation
10.1.5
By-Group Operations
10.1.6
Merge
10.1.7
Reshape
10.2
JSON
10.3
Databases
11
Error Handling
12
Parallel Computing
13
Programming with S4
14
Unit-Testing
15
Language Co-Working
15.1
Use system call
15.2
Pipelines: stdin and stdout
15.3
Environment Variables
15.4
Command Line Arguments Revisited
15.5
With Configuration Files
16
Speed-up with Rcpp
16.1
What exactly is R?
16.1.1
Distribution of source file counts in R
16.1.2
Distribution of source line counts in R
16.2
Speed-Up
16.2.1
Example 1: n-gram generation
16.2.2
Example 2: moving-window computing
16.2.3
Example 3: ad-hoc data.frame operation
17
References
Published with bookdown
RBasic 101
Chapter 17
References