Description Usage Arguments Value Examples
One of the main functionalities of the package. It is an alternative to standard way we define matrices in R.
1 |
... |
Single values, vectors, matrices and '|' as special symbol which breaks input on the rows. |
matrix with defines elements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Typically, we define matrices like this:
x <- matrix(c(1, 2, 3,
4, 5, 6,
7, 8, 9), nrow=3, byrow=TRUE)
x
# However, this way of ceating matices seems to be
# a little bit clunky. Using `matricks`, we can do
# it in more staightforward way dividing our input
# into rows by using special symbol `|`
x <- m(1, 2, 3|
4, 5, 6|
7, 8, 9)
x
# Moreover, we can pass to the `m` function
# whole sequences or even matrices.
x <- m(1:5 | 6:10 | 11:15 )
x
# We can combine multiple matrices into one
m(diag(3), diag(3) * 3|
diag(3) * 3, diag(3) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.