I don't exactly know what you mean by yes/no table. would everything be yes, as if its not in the initial table its not known about, and when rearranging the info in the initial table nothing should be lost... i.e. what would correspond to a 'no' ?
Completely guessing, but are you trying to count the combinations ?
library(tidyverse)
(some_data <- data.frame(
Code=c(letters[1:5],letters[1:3]),
Out.Subind = c(1:5,1:3)
))
# maybe you want to count?
some_data %>% group_by_all() %>% count() %>%
pivot_wider(names_from=c("Code","Out.Subind"),
values_from="n")