Performs an arithmetic function, FUN, over a series of traits and returns the result as a derived trait. Traits must be specified as either lists or single row data frames, and must be either single data points or normally distributed. In the event one or more input traits are normally distributed, the resulting distribution is approximated by numerical simulation. The output trait is effectively a copy of the first input trait with modified mean, stat, and n.

derive.trait(FUN, ..., input = list(...), var.name = NA,
  sample.size = 10^6)

Arguments

FUN

arithmetic function

...

traits that will be supplied to FUN as input

input

list of trait inputs. See examples

var.name

name to use in output

sample.size

number of random samples generated by rnorm for normally distributed trait input

Value

a copy of the first input trait with mean, stat, and n reflecting the derived trait

Examples

# NOT RUN {
input <- list(x = data.frame(mean = 1, stat = 1, n = 1))
derive.trait(FUN = identity, input = input, var.name = 'x')
# }