ECON 413
Basic R functions
Erol
Taymaz
Department of Economics
Middle East Technical
University
install.packages, update.packages, library, require
setwd, getwd
?, ??, rm, ls, ls.str, system.time, object.size
<- or = (use <-)
:
c
*, +, -, /, ^, %%, %/%, %*%
abs, sign, acos, asin, atan, atan2, sin, cos, tan
ceiling, floor, round, trunc, signif
exp, log, log10, log2, sqrt
sum, cumsum, cummax, shift, lead, lag
mean, sd, min, max, pmax, pmin
%in%, %between%
&, |, !, xor
str, class, summary, describe, head, tail
table, xtabs, dim, ncol, nrow, length, nchar, names
subset
factor, ordered
vector, matrix, array, list, numeric, character
rep, seq
data.frame, data.table
cbind, rbind, merge, reshape
identical, na.omit
within, with
is.numeric, is.integer, …
as.numeric, as.integer, as.data.frame, …
set.seed, sample
rnorm, runif, …
as.Date, months, weekdays, …
for, while, repeat
stop, break, next
paste, paste0
substr
sub, gsub
grep, grepl, regexpr, gregexpr, regexec
Sys.getlocale, Sys.setlocale(“LC_TIME”, “tr_TR.utf8”)
Sys.info, Sys.time, Sys.date
cat, print
readline
Sys.sleep
read.csv, read.table, write.csv
load, save
fread, fwrite
read.xls, read_stata
pi, letters, LETTERS, month.abb, month.name
[
[[