adjust: A generic function to scale the values of a vector between -1 and 1. This function is a subfunction of IDM.
Description
A generic function to scale the values of a vector between -1 and 1. The function is used in the IDM calculation, to scale a vector of ages at which size has been measured.
Usage
adjust(age)
Arguments
age
A numeric vector containing ages to be scaled between -1 and 1.
References
Kirkpatrick M, Lofsvold D, Bulmer M (1990) Analysis of the inheritance, selection and evolution of growth trajectories. Genetics 124:979-993.
# The function is currently defined asfunction(age){
u=-1v=1n=length(age)
amin=min(age)
amax=max(age)
temp=u+(v-u)/(amax-amin)*(age-amin)
return(temp)
}