make_mat | R Documentation |
This function help users to easily make a two-way table from a "long format" data.
make_mat(.data, row, col, value, fun = mean)
.data |
The dataset. Must contains at least two categorical columns. |
row |
The column of data in which the mean of each level will correspond to one line in the output. |
col |
The column of data in which the mean of each level will correspond to one column in the output. |
value |
The column of data that contains the values to fill the two-way table. |
fun |
The function to apply. Defaults to |
A two-way table with the argument row
in the rows, col
in the columns, filled by the argument value
.
Tiago Olivoto tiagoolivoto@gmail.com
library(metan) matrix <- data_ge %>% make_mat(row = GEN, col = ENV, val = GY) matrix # standart error of mean data_ge %>% make_mat(GEN, ENV, GY, sem)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.