Question: ### Q5a: Now we will clean the variable that measures how often the respondent ate fruit per day or per week or per month using
### Q5a: Now we will clean the variable that measures how often the respondent ate fruit per day or per week or per month using R. Create a new dataframe named `brf_Q5a` that is the same as `brf_Q2` except that you'll add a new variable to it named `FRTDAY` that converts all of the responses into fruits eaten *per day*. Be sure to account for 0 days. Use 30 days per month, 7 days per week, and 0.02 for less than once a month in your conversion calculations. Be sure to round any conversion calculations to two decimal places. Place the new column as the first column in the dataframe.
The resulting dataframe should still have NAs for FRTDAY at this point.
Do not do anything with respondents who said "don't know/not sure" or refused to respond. We will handle those responses in the next section.
Hint: The resulting dataframe is 431,750 x 4.
Hint: Select values for rows 1, 65, and 117 are shown below.
``` FRTDAY FRUIT2 CHECKUP1 GENHLTH 1 1.00 101 2 1 ... 65 NA NA 2 1 ... 117 0.14 201 3 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
