Function Repository Resource:

# Proportions

Get the proportion of times that each distinct element appears in a list

Contributed by: Richard Hennigan (Wolfram Research)
 ResourceFunction["Proportions"][list] gives an association whose keys are the distinct elements of list, and whose values give the proportion of times those elements appear in list.

## Details and Options

ResourceFunction["Proportions"][list] gives an association whose keys are in the same order as they first occur as elements of list.
ResourceFunction["Proportions"] also works with heads other than List.
When given an Association, ResourceFunction["Proportions"] uses the Values of the association as input.

## Examples

### Basic Examples (4)

Find the proportions of times that each element appears in a list:

 In[1]:=
 Out[1]=

Use with an Association:

 In[2]:=
 Out[2]=

See how common each character is in a body of text:

 In[3]:=
 Out[3]=

Check for common words:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

Visualize in a WordCloud:

 In[6]:=
 Out[6]=

### Properties and Relations (1)

Proportions is similar to Counts:

 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=

## Requirements

Wolfram Language 11.3 (March 2018) or above

## Version History

• 1.0.0 – 28 March 2019