powered by
Reshape a long format data.table using key-value pairs with data.table::dcast
data.table
data.table::dcast
dt_keybin_reshape( x, id_name, key_name, positive = 1, negative = 0, xname = NULL, verbosity = 1L )
data.table in wide format.
data.table object.
Character: Name of column in x that defines the IDs identifying individual rows.
x
Character: Name of column in x that holds the key.
Numeric or Character: Used to fill id ~ key combination present in the long format input x.
Numeric or Character: Used to fill id ~ key combination NOT present in the long format input x.
Character: Name of x to be used in messages.
Integer: Verbosity level.
EDG
library(data.table) 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")
Run the code above in your browser using DataLab