#Minimal example:
#One attribute with 3 levels, 2 subjects, 3 alternatives, 2 tasks
dt <- structure(list(id = c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
2L, 2L),
task = c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L),
alt = c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L),
x = c(1, 0, 2, 1, 0, 1, 2, 3, 1, 1, 0, 1),
p = c(0, 1, 1, 1, 2, 0, 2, 2, 1, 2, 1, 1),
attr2 = c(1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0),
attr1 = c(0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1)),
class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,-12L))
test <- dt %>% dplyr::select(-all_of("x")) %>% vd_prepare_nox()
Run the code above in your browser using DataLab