safeGPfunctions: Some simple arithmetic and logic functions for use in GP...

Description Usage Arguments

Description

safeDivide a division operator that returns 0 if the divisor is 0. safeLn a natural logarithm operator that return 0 if its argument is less then 0. ln is the natural logarithm. positive returns true if its argument is greater then 0. ifPositive returns its second argument if its first argument is positive, otherwise its third argument. ifThenElse returns its second argument if its first argument is TRUE, otherwise its third argument.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
safeDivide(a, b)

safeSqroot(a)

safeLn(a)

ln(a)

positive(x)

ifPositive(x, thenbranch, elsebranch)

ifThenElse(x, thenbranch, elsebranch)

Arguments

a

A numeric value.

b

A numeric value.

x

A numeric value.

thenbranch

The element to return when x is TRUE.

elsebranch

The element to return when x is FALSE.


rgp documentation built on May 30, 2017, 12:45 a.m.