Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Create and Use Factors | R Factors Explained
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Working with Data Structures in R

bookChallenge: Create and Use Factors

Tâche

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

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Create and Use Factors

Glissez pour afficher le menu

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
single

single

some-alt