I have a character vector and I want to randomly assign numerical categories 1, 2, or 3 to each character string in the character vector. How can I do this in R
Input
Species
Species1
Species2
Species3
Species4
Species5
Example output
Species Category
Species1 2
Species2 1
Species3 1
Species4 3
Species5 3
Aucun commentaire:
Enregistrer un commentaire