Add new column with tags computed from other columns Tags

Viewed 21

I hope the Title is fitting. I have this data set Starting data frame

And whant to compare TypeX and TypeY so that the new column "Type" will result in (if one row has value missing the "Type" column will show A,B,C or D and if both TypeX and TypY is missing that row in column "Type" will show missing. Below is a picture that describes this:

Goal data frame

How do I compute this with character values into the wished for data frame in a efficient way. I am new to R and would appriciate your help

0 Answers
Related