whiskR_vignette.Rmd
Gary Truong, Ben Walker, Anna Lewis
whiskR
is used for calculating segment lengths of whiskers and working out how many days are represented by each segment.
The formulas used in the functions are derived from the Von Bertanlanffy growth model equations.
Variables that are used include whisker length, asymptotic length, the growth coefficient k and time.
The segment() function is used for calculating the sampling sections for a single whisker. It uses the LP1 function in this package using 1 day as the time arrgument as default
To install whiskR
in R:
# Install pacman install.packages("pacman") pacman::p_load(devtools) # Install whiskR devtools::install_github("GaryTruong/whiskR") library(whiskR)
L.max is the maximum length that the whisker will grow to. The example provided has a max length of 148.5mm
L.asym is the asymptotic length for that whisker position. The asymptotic length in the example is 150mm
Time is the time period that the whisker will grow for until it reaches maximum length The time period for the example given is 365 days.
The LP1() function is used to calculate the specific length of segment required to be in order to obtain a sample that represents a specific amount of time
L is length
LP1()
TP1() is used to calculate how much time is represented by a given segment of whisker.
TP1()
The maxTime() function calculates the maximum time represented by a whisker
maxTime()
section() uses the LP1 function to generate a table of all of the section lengths corresponding to a specified period time of growth. The default period of time represented is 1 day. A higher number of sections generates samples that approximate the actual time represented by the whisker growth. A fewer number of cuts or higher period of time represented results with an underestimation of the actual time represented by the whisker.
section()