Question: Please use R or R studio: Create a new variable, generation_group , that represents the generation of the LJ customers and add it to the
Please use R or R studio:
Create a new variable, generation_group, that represents the generation of the LJ customers and add it to the LJ.trans dataset. More specifically, generation_group variable takes a value Post-Millennials for ages between 1 and 21 (including 1 and 21), Millennials for ages between 22 and 37 (including 22 and 37), Generation X for ages between 38 and 53 (including 38 and 53), and Baby Boomers for ages between 54 and 72 (including 54 and 72). Please use for() and if else() functions or ifelse() function to create the generation_group variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
