Dropping levels in a factor variable
Assume you have a data frame (df) for patients taking a specific drug. The data consists of a factor variable (Drug) and a numeric variable (N_patients).
Drugs
N_patients
Drug 1
50
Drug 2
40
Drug 3
23
Drug 4
92
Drug 5
70
Later on you filter the data frame for specific levels in the factor variable and ... [Read more...]