View source: R/add_mixed_layout.R
add_mixed_layout | R Documentation |
Add a layout column to long format data for mixed layouts.
add_mixed_layout(
x,
rows = "row",
cols = "col",
values = "value",
layout,
name = "layout"
)
x |
Long format data frame of a symmetric matrix. |
rows , cols , values |
Columns containing rows, columns, and values. |
layout |
Character vector of length two with a mixed layout (two opposing triangles). |
name |
Name of the column that should contain the layouts. |
The input data frame with a new column added, showing in which triangle each value would be in a mixed layout.
# Make long format symmetric data
long_df <- data.frame(rw = rep(letters[1:4], 4),
cl = rep(letters[1:4], each = 4),
val = 0)
long_df <- add_mixed_layout(long_df, rw, cl, val,
layout = c("topleft", "bottomright"))
head(long_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.