transform(deprecated)/tally - Help

stats[transform, tally]

group together data of same value

 Calling Sequence stats[transform, tally](data) transform[tally](data)

Parameters

 data - statistical list

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The tally function of the subpackage stats[transform, ...] groups together the items of data that have the same value.
 • The ordering of the result is unpredictable. The utility stats[transform, statsort] can be useful.
 • To regroup data into a particular target pattern, use stats[transform, tallyinto].

Examples

Important: The stats package has been deprecated. Use the superseding package Statistics instead.

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data1}≔\left[10,10,10,20,20,30\right]$
 ${\mathrm{data1}}{:=}\left[{10}{,}{10}{,}{10}{,}{20}{,}{20}{,}{30}\right]$ (1)
 > $\mathrm{transform}[\mathrm{tally}]\left(\mathrm{data1}\right)$
 $\left[{\mathrm{Weight}}{}\left({10}{,}{3}\right){,}{\mathrm{Weight}}{}\left({20}{,}{2}\right){,}{30}\right]$ (2)
 > $\mathrm{data2}≔\left[1,2,3,\mathrm{missing},3,4..5,4..5,\mathrm{Weight}\left(4..5,6\right),6..7,6..7\right]$
 ${\mathrm{data2}}{:=}\left[{1}{,}{2}{,}{3}{,}{\mathrm{missing}}{,}{3}{,}{4}{..}{5}{,}{4}{..}{5}{,}{\mathrm{Weight}}{}\left({4}{..}{5}{,}{6}\right){,}{6}{..}{7}{,}{6}{..}{7}\right]$ (3)
 > $\mathrm{transform}[\mathrm{tally}]\left(\mathrm{data2}\right)$
 $\left[{\mathrm{missing}}{,}{1}{,}{2}{,}{\mathrm{Weight}}{}\left({3}{,}{2}\right){,}{\mathrm{Weight}}{}\left({4}{..}{5}{,}{8}\right){,}{\mathrm{Weight}}{}\left({6}{..}{7}{,}{2}\right)\right]$ (4)