Turtle, Observer, Patch

variance-of-patches-with [condition] [list of commands]

Parameters:
[condition] List of patch commands An expression that returns a true or false value
[list of commands] List of patch commands A list of commands for the patches to run which returns a number

Description:
Returns the numerical variance of the [list of commands] when evaluated across all the patches that satisfy the condition (must return a boolean of true or false) specified by the [condition].

Examples:
variance-of-patches-with [color = red] [food] returns the variance of food of all the red patches.

Notes:
If [list of commands] contains no numbers, an error occurs. If some of the [list of commands], when evaluated, are not numbers, those values are ignored.

Related Commands:
average-of-patches-with max-of-patches-with median-of-patches-with min-of-patches-with mode-of-patches-with sdev-of-patches-with sum-of-patches-with variance-of-patches