Nothing
#' Predict development rate from a matrix of temperatures
#'
#' Create a map from a temperature matrix and a development rate curve
#'
#' @param nlsDR The result returned by the \code{devRateModel} function.
#' @param tempMap A matrix containing temperatures in degrees.
#' @return A matrix with development rates predicted from the model.
#' @details The \code{devRateMap} function is designed for a single ectotherm
#' life stage, but the resulted matrix of development rate can be performed
#' for each life stage in order to obtain the whole organism development.
#' Input temperatures should preferably cover the organism development period
#' rather than the whole year.
#' @examples
#' myT <- 5:15
#' myDev <- -0.05 + rnorm(n = length(myT), mean = myT, sd = 1) * 0.01
#' myNLS <- devRateModel(eq = campbell_74, temp = myT, devRate = myDev,
#' startValues = list(aa = 0, bb = 0))
#' myMap <- devRateMap(nlsDR = myNLS, tempMap = matrix(rnorm(100, mean = 12, sd = 2), ncol=10))
#' @export
devRateMap <- function(nlsDR, tempMap){
mapDev <- matrix(stats::predict(nlsDR, newdata = list(T = c(tempMap))), ncol = ncol(tempMap))
mapDev[mapDev < 0] <- 0
return(mapDev)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.