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Β 1. ChapterΒ 14
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
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Β 1. ChapterΒ 14
single