How would you loop through the values in one column looking for a specific set of characters and then, if the row has those characters, assign a value specifically to that row in a new column?
For example, in this problem we must assign one point to every disagreeing response and zero to the agreeing ones.
Id Gender Age Participate Question Response Score
<int> <chr> <int> <int> <chr> <chr> <dbl>
1 16 Male 20 1 Q1 Slightly Disagree 0
2 17 Male 40 1 Q1 Definitely Agree 0
3 18 Male 33 1 Q1 Definitely Agree 0
4 19 Male 18 1 Q1 Definitely Agree 0
5 20 Male 24 1 Q1 Definitely Disagree 0
6 21 Female 42 1 Q1 Slightly Disagree 0
7 22 Female 19 1 Q1 Slightly Agree 0
8 28 Female 49 1 Q1 Slightly Disagree 0
9 29 Female 17 1 Q1 Slightly Agree 0
10 31 Male 18 1 Q1 Slightly Agree 0`