Important Commands

In the section I will list the most important commands in base R. The list is taken in large part from Hadley Wickham’s book Advanced R. Most of them we already discussed. Those we have not you can read up on yourself.

The first functions to learn

? str

Important operators and assignment

%in%, match
=, <-, <<-
$, [, [[, head, tail, subset
with
assign, get

Comparison

all.equal, identical
!=, ==, >, >=, <, <=
is.na, complete.cases
is.finite

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)

Matrix algebra

crossprod, tcrossprod
eigen, qr, svd
%*%, %o%, outer
rcond
solve

Workspace

ls, exists, rm
getwd, setwd
q
source
install.packages, library, require

Help

help, ?
help.search
apropos
RSiteSearch
citation
demo
example
vignette

Debugging

traceback
browser
recover
options(error = )
stop, warning, message
tryCatch, try

Output

print, cat
message, warning
dput
format
sink, capture.output

Reading and writing data

data
count.fields
read.csv, write.csv
read.delim, write.delim
read.fwf
readLines, writeLines
readRDS, saveRDS
load, save
library

Files and directories

dir
basename, dirname, tools::file_ext
file.path
path.expand, normalizePath
file.choose
file.copy, file.create, file.remove, file.rename, dir.create
file.exists, file.info
tempdir, tempfile
download.file,