Challenge: Work with Factors and Characters
Task
Swipe to start coding
Convert a character vector of product categories to a factor. Using factors for categorical data can improve efficiency and provide better support for statistical analysis.
- Return a factor variable that represents the categories in the input vector.
- Ensure the result contains the unique levels present in the input.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain that in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Awesome!
Completion rate improved to 5.56
Challenge: Work with Factors and Characters
Swipe to show menu
Task
Swipe to start coding
Convert a character vector of product categories to a factor. Using factors for categorical data can improve efficiency and provide better support for statistical analysis.
- Return a factor variable that represents the categories in the input vector.
- Ensure the result contains the unique levels present in the input.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 4
single