Vectors
a <- c(1, 2, 3)
b <- c(4, 5, 6)
mean_ab <- (a + b) / 2
d <- c(1, 0, 1)
only_1_3 <- a[d == 1]
Matrices
mat <- matrix(c(1,2,3,4), nrow = 2, ncol = 2)
dimnames(mat) <- list(c(), c("a", "b", "c"))
mat[,] == mat
Dataframes
df <...