String Frequency
This class tabulates the frequency associated with the strings presented to it via the collect() method. For every unique string presented a count is maintained. There could be space/time performance issues if the number of different strings presented is large. Use the limit set to limit the values that can be observed. If the presented strings are not in the limiting set, then they are counted as "Other".
This class can be useful for tabulating a discrete histogram over the values (strings) presented.
Author
rossetti
Parameters
a name for the instance
an array of data to tabulate
a set of strings that limit what is to be counted. If null, there is no limit. That is, every unique string presented is tabulated.
Properties
Returns an array of size numberOfCells containing the frequencies for each string observed. The 0th element is the frequency for the string stored at element 0 of the array returned by the values property
Returns the number of cells tabulated This is also the total number of different strings observed
Returns an array of size numberOfCells containing the proportion by value. The 0th element is the proportion for the value stored at element 0 of the array returned by the values property, etc.
Returns Map holding the string and cumulative proportions as elements in the map
Returns Map holding the observed strings and frequencies within the map
Returns Map holding the strings and associated proportions.
Functions
Returns a copy of the cells in a list.
Returns a copy of the cells in a list ordered by the count of each cell, 0th element is cell with the largest count, etc
Returns the cumulative frequency up to an including the string
Returns the cumulative proportion up to an including the supplied string
Interprets the elements of x[] as values and returns an array representing the frequency for each value
Returns the data associated with the tabulation.
Creates a plot for the integer frequencies. The parameter, proportions indicates whether proportions (true) or frequencies (false) will be shown on the plot. The default is false.
Gets the proportion of the observations that are equal to the supplied string