Groups are used to group a set of markers or labels. It helps in adding similar functionality to individual groups.
Create a group by using group attributes and assigning group names.
addMarkers(data = fb_branches, group = "Food & Drink")
addMarkers(data = el_branches, group = "Electronics")
You can use the showGroup and hideGroup functions to show and hide groups from code.
For more information on groups in leaflet, check out the below article.