Counting the amount of letters in all permutations of words in R
- by Rhodo
I have some words:
shapes<- c("Square", "Triangle","Octagon","Hexagon")
I want to arrange them in pairs:
shapescount<-combn(shapes, 2)
shapescount
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] "Square" "Square" "Square" "Triangle" "Triangle" "Octagon"
[2,] "Triangle" "Octagon" "Hexagon" "Octagon" "Hexagon" …