Learn R Programming

nlraa (version 1.9.7)

SScard3: self start for cardinal temperature response

Description

Self starter for cardinal temperature response function

Usage

card3(x, tb, to, tm)

SScard3(x, tb, to, tm)

Value

card3: vector of the same length as x using a card3 function

Arguments

x

input vector (x) which is normally ‘temperature’.

tb

base temperature

to

optimum temperature

tm

maximum temperature

Author

Caio dos Santos and Fernando Miguez

Details

This function is described in Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506)

Examples

Run this code
# \donttest{
## A temperature response function
require(ggplot2)
set.seed(1234)
x <- 1:50
y <- card3(x, 13, 25, 36) + rnorm(length(x), sd = 0.05)
dat1 <- data.frame(x = x, y = y)
fit1 <- nls(y ~ SScard3(x, tb, to, tm), data = dat1)

ggplot(data = dat1, aes(x, y)) + 
  geom_point() + 
  geom_line(aes(y = fitted(fit1)))
# }

Run the code above in your browser using DataLab