Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Create and Use Factors | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Data Cleaning and Transformation with Data Frames in R - 1768563984993
SectionΒ 1. ChapterΒ 14
single

single

bookChallenge: 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_responses vector 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 to structure_info.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 14
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt