vec2mat2(c("a-b", "a-c", "b-c"))
vec2mat2(c("a-b", "b-a"))
# \dontshow{
(tst3 <- substring(try(
vec2mat2(c("a", "b-a", "b-c"))), 1, 20)
=="Error in vec2mat2(c(")
# Error: name without a sep character
(tst4 <- substring(try(
vec2mat2(c("a-c", "b-a", "b-c-d"))), 1, 20)
=="Error in vec2mat2(c(")
# Error: multiple hyphens (sep characters)
# }
Run the code above in your browser using DataLab