Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Mutate Customer Data | Data Manipulation with dplyr
Data Manipulation in R (Core)

bookChallenge: Mutate Customer Data

Tâche

Swipe to start coding

Practice using mutate() to add new columns for customer segmentation. Your goal is to create an age column and a segment column in the given data frame.

  • Add a new column age to the data frame, calculated as 2024 - birth_year.
  • Add a new column segment to the data frame, assigning "youth" if age is less than 25, "adult" if age is 25 or older but less than 65, and "senior" if age is 65 or older.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
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: Mutate Customer Data

Glissez pour afficher le menu

Tâche

Swipe to start coding

Practice using mutate() to add new columns for customer segmentation. Your goal is to create an age column and a segment column in the given data frame.

  • Add a new column age to the data frame, calculated as 2024 - birth_year.
  • Add a new column segment to the data frame, assigning "youth" if age is less than 25, "adult" if age is 25 or older but less than 65, and "senior" if age is 65 or older.

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 1. Chapitre 4
single

single

some-alt