Factor creation
📖 Scenario: You work in a small company that collects survey data about customer satisfaction. The survey answers are stored as text, but you want to organize them better for analysis.
🎯 Goal: You will create a factor variable in R from a character vector of survey answers. This will help group and analyze the answers easily.
📋 What You'll Learn
Create a character vector with exact survey answers
Create a factor variable from the character vector
Specify the levels of the factor in a given order
Print the factor variable to see the result
💡 Why This Matters
🌍 Real World
Survey data often comes as text answers. Converting them to factors helps organize and analyze the data efficiently.
💼 Career
Data analysts and statisticians use factors to handle categorical data in R for reports and visualizations.
Progress0 / 4 steps