-
Notifications
You must be signed in to change notification settings - Fork 0
/
vocabulary.Rmd
140 lines (118 loc) · 2.07 KB
/
vocabulary.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
title: "Vocabulary"
author: "David McAllister"
date: "31st October 2016"
output:
pdf_document: default
---
see also http://cran.r-project.org/doc/contrib/Short-refcard.pdf
# Vocabulary which may be needed for questions
### Important operators and assignment
%in%, match
=, <-, <<-
$, [, [[, head, tail, subset
with
*assign, get*
### Comparison
all.equal, identical
!=, ==, >, >=, <, <=
is.na, complete.cases
is.finite
### Basic math
*, +, -, /, ^, %%, %/%
abs, sign
ceiling, floor, round, trunc, signif
exp, log, log10, log2, sqrt
max, min, prod, sum
cummax, cummin, cumprod, cumsum, diff
pmax, pmin
range
mean, median, cor, sd, var
### Functions to do with functions
function
*missing*
*on.exit*
return, invisible
### Logical & sets
&, |, !, xor
all, any
intersect, union, setdiff, setequal
which
### Vectors and matrices
c, matrix
automatic coercion rules character > numeric > logical
vector
length, dim, ncol, nrow
cbind, rbind
names, colnames, rownames
t
*diag*
*sweep*
as.matrix, data.matrix
### Making vectors
c
rep, rep_len
seq, seq_len, seq_along
rev
sample
### Lists & data.frames
list, unlist
data.frame, as.data.frame
split
expand.grid
### Control flow
if, &&, || (short circuiting)
for, while
next, break
switch
ifelse
### Apply & friends
lapply, sapply
apply
tapply
### Character manipulation
grep, agrep
gsub
strsplit
chartr
nchar
tolower, toupper
substr
paste
library(stringr)
### Factors
factor, levels
reorder, relevel
cut, findInterval
interaction
options(stringsAsFactors = FALSE)
### Ordering and tabulating
duplicated, unique
merge
order, rank, quantile
sort
table, ftable
### Random variables
(q, p, d, r) * (beta, binom, cauchy, chisq, exp, f, gamma, geom,
hyper, lnorm, logis, multinom, nbinom, norm, pois, signrank, t,
unif, weibull, wilcox, birthday, tukey)
### Workspace
ls, exists, rm
getwd, setwd
q
source
install.packages, library, require
### Help
help, ?
help.search, ??
example
vignette
### Reading and writing data
data
read.csv, write.csv
read.delim, write.delim
read.fwf
readLines, writeLines
load, save
library(foreign)
# Back to lecture