# Comment: Another possible alternative is to use expand.grid(values, suits)# But in that case we would later have to combine the characters with paste manually.################ ## Exercise 4 ## ################choose(52,5)

Hello Anthony, Thank you for the comment. Your solution is as good as mine in this case, might also be considered better as it doesn’t require the knowledge of FUN parameter in “outer”. Also don’t know if you noticed, but I had left a comment about this at the end of exercise 3 solution:

# Comment: Another possible alternative is to use expand.grid(values, suits)
# But in that case we would later have to combine the characters with paste manually.

Thank you for the comment. Your way of doing it is definitely correct. I chose combn(colors, 3, FUN=sort) as an answer to demonstrate additional “FUN” parameter of the combn function. But other than that both answers get the job done.

Let’s Spread the Word about R-exercises!

If you enjoy our free exercises, we’d like to ask you a small favor: Please help us spread the word about R-exercises. Go to your preferred site with resources on R, either within your university, the R community, or at work, and kindly ask the webmaster to add a link to www.r-exercises.com. We very much appreciate your help!