Challenge: Avoid Factor Pitfalls
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Awesome!
Completion rate improved to 5.56
Challenge: Avoid Factor Pitfalls
Swipe to show menu
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 6
single