Find Unique Combinations of All Elements from Two Vectors in R (2 Examples) | expand.grid & crossing

Find Unique Combinations of All Elements from Two Vectors in R (2 Examples) | expand.grid & crossing

How to identify unique combinations of all elements of two vectors or arrays in the R programming language. More details: https://statisticsglobe.com/unique-co... R code of this video: vec1 <- c("A", "B", "AA", "CDE") # Create example vectors vec2 <- 1:3 expand.grid(vec1, vec2) # Apply expand.grid function install.packages("tidyr") # Install & load tidyr library("tidyr") crossing(vec1, vec2) # Apply crossing function Follow me on Social Media: Twitter:   / joachimschork   Reddit:   / joachimschork   Pinterest: https://www.pinterest.de/JoachimSchork