knitr::opts_chunk$set(echo = TRUE)
mmr provides simple helpers for matrix multiplication on data.frames. These allow for more concise code during low level mathematical operations, and help ensure code is more easily read, understood, and serviced.
# install.packages("mmr") library(mmr)
data.framesmm() accepts two data.frame's and returns their matrix product:
x <- data.frame(a=c(1,2,3), b=c(5,6,7)) y <- c(2,2) mm(x, y)
%mm% offers the same functionality in infix form:
x <- data.frame(a=c(1,2,3), b=c(5,6,7)) y <- c(2,2) x %mm% y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.