행렬 그냥 곱

Published by onesixx on

 

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

 

 

Categories: Statistics

onesixx

Blog Owner

Leave a Reply

Your email address will not be published.