I would like to add a column to my spark data frame that stores which line in its particular group it is.
Dataset = 'countries' containing (France, France, France, US, France, US, China)
if I do countries %>% group_by(country) %>% mutate( .... )
As a result of these operations I want for example this as output:
Does anyone know how to implement this?