Seksjon 1. Kapittel 8
single
Challenge: Transforming and Recoding Variables
Sveip for å vise menyen
Oppgave
Sveip for å begynne å kode
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.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 8
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår