Skip to content
Prev 374807 / 398506 Next

Grouping by 3 variable and renaming groups

Hello,

Sorry, but I think my first answer is wrong.
You probably want something along the lines of


sp <- split(priceStore_Grps, priceStore_Grps$StorePC)
res <- lapply(seq_along(sp), function(i){
     sp[[i]]$StoreID <- paste("Store", i, sep = "_")
     sp[[i]]
})
res <- do.call(rbind, res)
row.names(res) <- NULL


Hope this helps,

Rui Barradas
On 5/26/2018 2:22 PM, Rui Barradas wrote: