I have a colum in a dataframe called “Inheritance” and the observations:
Autosomal dominant
Autosomal dominant, digenic
Autosomal dominant, autosomal recessive
Autosomal recessive
Autosomal recessive, digenic
X-linked autosomal
X-linked recessive
I want to rename the observations (to regroup into less groups) that contains “Autosomal dominant”, “Autosomal dominat, digenic”, "Autosomal dominat, autosomal recessive” to “AD”, regardeless if “Autosomal dominat” cames with another classification in the same observation. And “Autosomal recessive” to “AR”. Also, “X-linked autosomal” and “X-linked recessive” as “X”. How can I tell R to consider just a couple of words and ignoring the other ones?