freq ()

Read(2157) Label: sequence, frequency,

Description

Calculate the frequency of a specified member in a sequence.

Syntax:

A.freq(o)

Note:

The external library function (See External Library Guide) calculates the frequency of o in sequence A; if parameter o is absent, find the frequency of null values (including empty strings and NA).

Parameter:

A

A sequence

o

A string/number

Return value:

A double-precision number

Example:

 

A

 

1

[0,NA,2,3,,5,6,3,100,9]

 

2

=A1.freq(3)

Member 3 in A1’s sequence appears twice, and the frequency is 2/10=0.2.

3

=A1.freq()

Return the frequency of null value.