Say I have a data set
car_manu owner
ford 1
toyota 1
ford 2
ford 3
ford 3
ford 3
I'd like to make a variable that says if they're a 'one car owner' - this would mean owner 2 is one car owner. I know this would use the unique(df$owner)
but I'm not sure to assign this to an observation.
The expected output is
car_manu owner type
ford 1 multicar
toyota 1 multicar
ford 2 onecar
ford 3 multicar
ford 3 multicar
ford 3 multicar