#numeric vector
y <- case_weights(
x = c(0, 0, 1, 1)
)
#logical vector
y <- case_weights(
x = c(TRUE, TRUE, FALSE, FALSE)
)
#character vector
y <- case_weights(
x = c("a", "a", "b", "c")
)
Run the code above in your browser using DataLab