Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Mutate Customer Data | Data Manipulation with dplyr
Practice
Projects
Quizzes & Challenges
Quizzen
Challenges
/
Data Manipulation in R (Core)

bookChallenge: Mutate Customer Data

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Mutate Customer Data

Veeg om het menu te tonen

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

some-alt