Next Previous Up Contents
Next: Maths
Up: Functions
Previous: KCorrections

#### 10.6.12 Lists

Functions which operate on lists of values.

Some of these resemble similar functions in the `Arrays` class, and in some cases are interchangeable, but these are easier to use on non-array values because you don't have to explicitly wrap up lists of arguments as an array. However, for implementation reasons, most of the functions defined here can be used on values which are already `double[]` arrays (for instance array-valued columns) rather than as comma-separated lists of floating point values.

`sum( values, ... )`
  Returns the sum of all the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): sum of `values`
  - Examples:
    - `sum(1, 3, 99) = 103`
    - `sum(1, 3, NaN) = 4`
`mean( values, ... )`
  Returns the mean of all the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): mean of `values`
  - Examples:
    - `mean(2, 4, 6, 8) = 5`
    - `mean(100.5, 99.5, NaN) = 100`
`variance( values, ... )`
  Returns the population variance of the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): population variance of `values`
  - Examples:
    - `variance(0, 3, 4, 3, 0) = 2.8`
    - `variance(0, 3, NaN, 3, NaN) = 2`
`stdev( values, ... )`
  Returns the population standard deviation of the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): population standard deviation of `values`
  - Example:
    - `stdev(-3, -2, 0, 0, 1, 2, 3, 4, 5, 6) = 2.8`
`min( values, ... )`
  Returns the minimum of all the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): minimum of `values`
  - Example:
    - `min(20, 25, -50, NaN, 101) = -50`
`max( values, ... )`
  Returns the maximum of all the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): maximum of `values`
  - Example:
    - `max(20, 25, -50, NaN, 101) = 101`
`median( values, ... )`
  Returns the median of all the non-blank supplied arguments.

  - Parameters:
    - `values` (floating point, one or more): one or more numeric values
  - Return value
    - (floating point): median of `values`
  - Example:
    - `median(-100000, 5, 6, 7, 8) = 6`
`countTrue( values, ... )`
  Returns the number of true values in a list of boolean arguments. Note if any of the values are blank, the result may be blank as well.

  - Parameters:
    - `values` (boolean, one or more): one or more true/false values
  - Return value
    - (integer): number of elements of `values` that are true
  - Example:
    - `countTrue(false, false, true, false, true) = 2`

Next Previous Up Contents
Next: Maths
Up: Functions
Previous: KCorrections

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk