Variables and value assignment:
a <- 1
a
a=13
a
R is a good tool to work with vectors
v1 <- c(1,3,5,6,8)
v1
v2 <- 4:8
v2
v3 <- rep(0,5)
v3
On vectors you can do various operations
v2 + 1
v2 * 3
Vectors can be combined into matrices
m1 <- cbind(v1,v2,v3)
m1
m2 <- rbind(v1,v2,v3)
m2
Matrices operations, eg. multiplication
m2 %*% m1
Matrices indexing to get rows and columns
m1[c(1,3,4),]
m1[1:4, 1:2]
How big is the matrix? Dimensions...
dim(m1)
More complex objects - lists
l1 <- list()
l1[[1]] <- m1
l1
l1[[2]] <- v2
l1
l1$description <- "turlututu"
l1
More complex objects
load("DEGlist.Rd")
class(y)
str(y)
y@.Data[[1]][1:10, 1:10]
attributes(y)
y$samples