The R %*% operator

后端 未结 4 1855
无人及你
无人及你 2020-12-06 04:35

What is this? I can\'t find help by using ?. (Sorry for being dumb)

> 1%*%1
     [,1]
[1,]    1
> 10%*%10
     [,1]
[1,]  100
> c(1:2)%         


        
4条回答
  •  余生分开走
    2020-12-06 05:04

    This operator is used to multiply a matrix with its transpose.

    M = matrix( c(2,6,5,1,10,4), nrow = 2,ncol = 3,byrow = TRUE)
    
    t = M %*% t(M)
    
    print(t)
    

    from tutorialspoints

提交回复
热议问题