Show Menu
Cheatography

r part1 Cheat Sheet (DRAFT) by

This is a Summary of the Lecture 1

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basic operators and functions

==
exact equality
!=
unequal
>
bigger
<
smaller
>=
bigger or equal
<=
smaller or equal
+
addition
-
subtra­ction
*
multip­lic­ation
/
division
^
power
sqrt(x)
square root
exp(x)
expone­ntial
log(x)
logarithm
sin(x)
sine
cos(x)
cosine
tan(x)
tangent
range(x)
range min max
min(x)
minimum
max(x)
maximum
length(x)
number of elementsn
sum(x)
sum
mean(x)
mean
var(x)
variance
R as a giant pocket calculator (**Basics)

Commands and Assign­ments

Valid names?
.name1

name.1

name.var_1
Help commands?
help.start()

help.search("something")

help(function)

?function

apropos("something")
Commands?
x<-­24+10

{x<­-24+10; sqrt(9); 1+1}

assign­("x", 1+1)
Matrix?
data <- 

c(1,2,­3,4­,5,­6,7­,8,9)

matrix­(da­ta,­nrow=3,

ncol=3­,by­row­=TRUE)
(** Basics)
 

Relax?

fortune()
is a function from the fortunes package that contains anecdotes
(*Addi­tional)

CRAN task views

install.packages("ctv")
library(ctv)
available.views()
install.views("Psychometrics",
coreOnly=TRUE)
update.views("Psychometrics")
MORE
(**Basics)
 

Cats!

(*Relax)
Intro to R for cats and cat lovers
Package catter­plots to make plots with cats