# NOT RUN {
# generate a data frame with two nominal variables without numeric values
el1 <- data.frame(
nominal_var_1 = c("d", "e", "e", "b", "a", "a"),
nominal_var_2 = c("J", "N", "O", "R", "R", "L")
)
# generate a data frame with two nominal variables with numeric values
el2 <- data.frame(
nominal_var_1 = c("d", "e", "e", "b", "a", "a"),
nominal_var_2 = c("J", "N", "O", "R", "R", "L"),
numeric_val = c(4, 5, 5, 8, 7, 7)
)
# run nominalAsBinet() to convert the edge list to the incidence matrix
inc_mat1 <- nominalAsBinet(el1)
inc_mat2 <- nominalAsBinet(el2)
# }
Run the code above in your browser using DataLab