행렬 그냥 곱

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

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x