Show Menu
Cheatography

R Cheat Sheet (DRAFT) by

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

vectores

crear
v1<­-c(­1,2,3)
longitud
length(v1)
si todo verdadero o cualquier verdadero
all(v1­);a­ny(v1)
indexado numerico
v1[1:3]; v1[c(1,6)]
indexado booleano
v1[is.n­a(v1)] <- 0
nombrar
c(first = 'a', ..)
 
names(v1) <- c('first', ..)
Group of elements of the SAME type
• R is a vectorized language, operations are applied to
each element of the vector automa­tically
• R has no concept of column vectors or row vectors
• Special vectors: letters and LETTER
 

factores