GAP:FrequencySort

Function type
This function takes as input a list, and outputs the list of frequencies of various items in the list.

Code
FrequencySort := function(L) local S;       S := Set(AsSortedList(L)); return(List(S,x -> [x,Length(Filtered(L,y -> y = x))])); end;;

Paste this code in front of the GAP prompt or copy it to a file and read the file from the GAP prompt.