"Sprigs of rosemary were often carried by people in the funeral procession and cast onto the coffin before burial, much as roses are today. And as an evergreen plant, rosemary was associated with eternal life. As a fragrant herb, it was also often placed inside coffins to conceal any odours that might be emerging from the corpse. This was important because bodies often lay in state for days and sometimes weeks before burial, while preparations were made and mourners travelled to attend the funeral."
http://theconversation.com/nine-weird-and-wonderful-facts-about-death-and-funeral-practices-70465
"Those in mourning would have been easily identified by their dress during the Elizabethan period. If the family was very wealthy, they may even provide black clothing for professional mourners. Black dresses, pins, stockings, gloves, and sprigs of rosemary in a hatband were all visible signals that a person was in mourning. Mourning rings were also a part of Elizabethan funeral traditions. Made to memorialize death, they often featured skulls, coffins, or crosses."
https://www.funeralwise.com/customs/society/shakespeare/
"Rosemary is commonly recognized as a symbol of remembrance - even Shakespeare noted its emblematic qualities in Hamlet . Sprigs of rosemary were used in ancient times, laid at gravesites to demonstrate loyalty."
http://www.funeralplanning101.com/memorial-gifts/rosemary.aspx