d <- data.frame(
actor = gl(100, 5),
session = gl(10, 50),
feature1 = rbinom(500, 1, prob = 0.33),
feature2 = rbinom(500, 1, prob = 0.25),
feature3 = rbinom(500, 1, prob = 0.50)
)
onehot1 <- import_onehot(d, feature1:feature3)
onehot2 <- import_onehot(d, feature1:feature3, "actor", "session")
Run the code above in your browser using DataLab