# matrice M <- matrix(c(5, 8, 10, 34, 7, 5), 2, 3) # nomi di riga e di colonna colnames(M) <- c("C1", "C2", "C3") rownames(M) <- c("R1", "R2") M attributes(M) # operazioni sulle matrici M + 2 # trasposta t(M) # dataframe come matrice as.matrix(cars) t(cars)