I'm trying to create this table:
library(data.table)
table <- data.table(
x = "D" ,
y = list(c("a", "b"), c("a", "b"),c("a", "b"),c("a", "b"), "test"))
table
I'd like to use rep() with maybe list():
table <- data.table(
x = "D" ,
y = list(rep(c("a", "b"), 4), "test")
)
But that's not the expected result.