View source: R/data_table_exports.R
layout_to_rowrecs_data_table | R Documentation |
Map data records from block records (where each record may be more than one row) to row records (where each record is a single row). Values specified in rowKeyColumns determine which sets of rows build up records and are copied into the result.
layout_to_rowrecs_data_table(
data,
...,
columnToTakeKeysFrom,
columnToTakeValuesFrom,
rowKeyColumns,
sep = "_"
)
data |
data.frame to work with (must be local, for remote please try |
... |
force later arguments to bind by name. |
columnToTakeKeysFrom |
character name of column build new column names from. |
columnToTakeValuesFrom |
character name of column to get values from. |
rowKeyColumns |
character array names columns that should be table keys. |
sep |
character if not null build more detailed column names. |
new data.frame with values moved to columns.
(d2 <- wrapr::build_frame(
"id" , "id2", "measure", "value" |
1 , "a" , "AUC" , 0.7 |
2 , "b" , "AUC" , 0.8 |
1 , "a" , "R2" , 0.4 |
2 , "b" , "R2" , 0.5 ))
(layout_to_rowrecs_data_table(d2,
columnToTakeKeysFrom = "measure",
columnToTakeValuesFrom = "value",
rowKeyColumns = c("id", "id2")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.