I have a tibble that looks something like this :
dep_code dep_color message <chr> <int> <chr> 1 10 1 One 2 10 1 NA 3 10 1 Two 4 10 1 NA 5 10 1 Four 6 10 1 NA 7 11 1 NA 8 11 1 Three 9 11 1 NA 10 11 1 NA 11 11 1 NA 12 11 1 NA 13 12 1 NA 14 12 1 NA 15 12 1 NA 16 12 1 NA 17 12 1 NA 18 12 1 NA
As you can see, it’s looking like long data. I’d like to sort of widen it, but while concatenating the strings contained in the message column for each id. It’d also be great if I could fill empty cells with a custom message. It would end up looking something like this :
dep_code dep_color message <chr> <int> <chr> 1 10 1 OneTwoFour 2 11 1 Three 3 12 1 No message
Any idea how I could go with this ? I’ve looked at various functions but found none that looked like they could deal with that.
Tried functions like summarise and pivot_wider. I’m not sure if they’re fit for this sort of thing or if it’s that I don’t yet know how to use them well enough. I’ve been looking over here, but didn’t manage to get anything working. It’s looking like the (seemingly useful) summarise function is deprecated ?
Thanks if you can help !