vendredi 2 avril 2021

if_else with multiple else conditions

I have a data frame d with 10123692 rows. One column c is an index from 1 to 118. I need to mutate a column e which gives me 1900 if d$c == 1, 1901 if d$c == 2, ... , 2017 if d$c == 118. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire