mercredi 29 septembre 2021

how to change a vector to corresponding names without using for loop

I have a vector c(1,3,4,2,5,4,3,1,6,3,1,4,2), and I want make 1="a", 2="b", and so on

So my final outputs should look like c(a,c,d,b...)

I know that I can use for loop and if statement to do this, but is there any other quicker ways to do?

Aucun commentaire:

Enregistrer un commentaire