dt_keybin_reshape | R Documentation |
Reshape a long format data.table
using key-value pairs with
data.table::dcast
dt_keybin_reshape(
x,
id_name,
key_name,
positive = 1,
negative = 0,
xname = NULL,
verbose = TRUE
)
x |
A |
id_name |
Character: Name of column in |
key_name |
Character: Name of column in |
positive |
Numeric or Character: Used to fill id ~ key combination
present in the long format input |
negative |
Numeric or Character: Used to fill id ~ key combination
NOT present in the long format input |
xname |
Character: Name of |
verbose |
Logical: If TRUE, print messages to the console |
E.D. Gennatas
## Not run:
x <- data.table(
ID = rep(1:3, each = 2),
Dx = c("A", "C", "B", "C", "D", "A")
)
dt_keybin_reshape(x, id_name = "ID", key_name = "Dx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.