행렬 그냥 곱
A <- matrix(data=c(2,5, 3,6, 4,7),ncol=2, byrow = TRUE ) b <- c(1,2,3) matrix(lapply(data.table(A), function(x){b*x}) %>% unlist(), ncol=2)
[,1] [,2] [1,] 2 5 [2,] 6 12 [3,] 12 21
A <- matrix(data=c(2,5, 3,6, 4,7),ncol=2, byrow = TRUE ) b <- c(1,2,3) matrix(lapply(data.table(A), function(x){b*x}) %>% unlist(), ncol=2)
[,1] [,2] [1,] 2 5 [2,] 6 12 [3,] 12 21