powered by
Pipe friendly wrapper to `diag(x) <- value`
set_diag(x, value)
a matrix
either a single value or a vector of length equal to the diagonal of `x`.
library(dplyr) matrix(0,3,3) %>% set_diag(1)
Run the code above in your browser using DataLab