Section 1. Chapitre 8
single
Challenge: Transforming and Recoding Variables
Glissez pour afficher le menu
Tâche
Glissez pour commencer à coder
Practice transforming and recoding variables in a simulated dataset using mutate() and case_when().
- Use
mutate()to create a new variable,score_scaled, which is thescoredivided by 100. - Create a new variable,
group_label, usingcase_when()to recode thegroupvariable: "A" becomes "Control", "B" becomes "Treatment", and any other value becomes "Unknown". - Return the resulting data frame with the new variables.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 8
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion