Challenge: Create and Use Factors
Task
Swipe to start coding
Create a factor variable from a vector of survey responses and set a custom order for its levels.
- Convert the
survey_responsesvector into a factor. - Use the order: "Dissatisfied", "Neutral", "Satisfied" for the factor levels.
- Assign the factor to a variable named
satisfaction_factor. - The factor should be ordered.
- Display the structure of the factor using the
str()function and assign the result tostructure_info.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 2
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 points I should remember?
Can you give me an example?
Awesome!
Completion rate improved to 5.56
Challenge: Create and Use Factors
Swipe to show menu
Task
Swipe to start coding
Create a factor variable from a vector of survey responses and set a custom order for its levels.
- Convert the
survey_responsesvector into a factor. - Use the order: "Dissatisfied", "Neutral", "Satisfied" for the factor levels.
- Assign the factor to a variable named
satisfaction_factor. - The factor should be ordered.
- Display the structure of the factor using the
str()function and assign the result tostructure_info.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 2
single