'Generate two vectors with unique strings that were randomly created according to two criteria
I'm trying to create strings according to two criterias:
I need one string containing each number from 1-12 I need exactly three strings that contains each letter A-B The final output is something like: 1_A, 2_A, 3_A, 4_B, 5_B, 6_B, 7_C, 8_C, 9_C, 10_D, 11_D, 12_D.
Thanks to the community I was able to accomplish this by using: first<-sample(paste(sample(12), rep(LETTERS[1-4], 3), sep='_'))
Now, I am trying to create a second vector using the same line of code, but I'm getting strings that are also part of the first. How can I generate two vectors that do not contain any repeated string? That is: if 1_A is in the first vector, then it can be in the second vector. I need to create two vectors that contain only unique strings.
Any help will appreciated.
All the best, Angelica r string
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
