intervalGRaverage | R Documentation |

Using previously calculated growth rates over time, calculates the Absolute Growth Rates for a specified interval using the weighted averages of AGRs for each time point in the interval (AGR) and the Relative Growth Rates for a specified interval using the weighted geometric means of RGRs for each time point in the interval (RGR).

**Note: this function is soft deprecated and may be removed in
future versions. Use byIndv4Intvl_GRsAvg.**

```
intervalGRaverage(responses, individuals = "Snapshot.ID.Tag",
which.rates = c("AGR","RGR"), suffices.rates=c("AGR","RGR"),
times = "Days", start.time, end.time, suffix.interval,
data, sep=".", na.rm=TRUE)
```

`responses` |
A |

`individuals` |
A |

`which.rates` |
A |

`suffices.rates` |
A |

`times` |
A |

`start.time` |
A |

`end.time` |
A |

`suffix.interval` |
A |

`data` |
A |

`sep` |
A |

`na.rm` |
A |

The `AGR`

for an interval is calculated as the weighted mean of the
AGRs for times within the interval. The RGR is calculated as the weighted
geometric mean of the RGRs for times within the interval; in fact the exponential is taken of the weighted means of the logs of the RGRs. The weights are
obtained from the `times`

. They are taken as the sum of half the time subintervals before and after each time, except for the end points; the end points are taken to be the subintervals at the start and end of the interval.

A `data.frame`

with the growth rates.
The name of each column is the concatenation of (i) one of
`responses`

, (ii) one of `AGR`

, `PGR`

or `RGR`

,
or the appropriate element of `suffices.rates`

, and (iii)
`suffix.interval`

, the three components being separated by
full stops.

Chris Brien

`intervalGRdiff`

, `intervalWUI`

, `splitValueCalculate`

, `getTimesSubset`

, `GrowthRates`

,

`splitSplines`

, `splitContGRdiff`

```
data(exampleData)
longi.dat <- splitSplines(data = longi.dat,
response = "PSA", response.smoothed = "sPSA",
x="xDAP",
individuals = "Snapshot.ID.Tag",
df = 4, deriv=1, suffices.deriv = "AGRdv",
extra.rate = c(RGRdv = "RGR"))
sPSA.GR <- intervalGRaverage(data = longi.dat,
responses = "sPSA", times = "DAP",
which.rates = c("AGR","RGR"),
suffices.rates = c("AGRdv","RGRdv"),
start.time = 31, end.time = 35,
suffix.interval = "31to35")
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.