In a dataframe I have two categorical variables, say
vr of a dataframe
df. This dataframe is quite large, but suppose that are 100 different levels in
qs, not necessary following a pattern. The column vector
vr - which I as said is also a categorical variable - has some missing values.
What I want to do is label the missing values that exist in
vr according to the corresponding category or value in
I know a priori that are 9 different categories in
qs for which
vr has missing values. Say, that the label for one category in
102and for this category in
qs there are missing values in
So, what I want then to do is
- if the category/label/value in qs==102 set vr==
- if the category/label/value in qs==250 set vr==
end so on.
Sadly, my dataframe is very complicated and I don't know how I can reproduce a simple dataframe.