TidyX Episode 124: Combining Multiple Conditions in a Single Column

Some of the best TidyX episodes are born out of questions from viewers or colleagues. This week, Ellis Hughes and I dip into the mailbag and answer a question from a colleague about identifying multiple conditions.

The colleague that had a data set with specific observations in one column. Their goal was to create a new column which put those observations into one of several conditional groups. The issue they were running into was that case_when() and ifelse() only output the first condition that is met. The colleague was looking for a way to append the conditional groups column with a comma separate string, so that some of the observations could match multiple conditional groups.

In this episode, we solve the problem in three different ways.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.