Challenge: Avoid Factor Pitfalls
Oppgave
Swipe to start coding
Convert a factor of survey ratings to numeric values and ensure the levels are ordered from lowest to highest satisfaction.
- Create a new factor from
ratings_factorwith levels ordered as "Poor", "Fair", "Good", "Excellent". - Convert the ordered factor to numeric values, where "Poor" is 1 and "Excellent" is 4.
- Return the resulting numeric vector.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 18
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
Fantastisk!
Completion rate forbedret til 5.56
Challenge: Avoid Factor Pitfalls
Sveip for å vise menyen
Oppgave
Swipe to start coding
Convert a factor of survey ratings to numeric values and ensure the levels are ordered from lowest to highest satisfaction.
- Create a new factor from
ratings_factorwith levels ordered as "Poor", "Fair", "Good", "Excellent". - Convert the ordered factor to numeric values, where "Poor" is 1 and "Excellent" is 4.
- Return the resulting numeric vector.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 18
single