I am trying to create an data frame that is generated from combinations of a list of character strings in R. For example, the list would be something like
list <- c("liz", "doug", "stacy")
The end output goal would be a data frame that would have rows that allow for each combination to be present, such as this:
df <- as.data.frame(cbind(c("liz", "liz", "doug"), c("doug", "stacy", "stacy")))
I'm trying to make so that each pair is it's own row, with no repeated combinations. Any thoughts on how to achieve this with larger character lists?
Thanks in advance.