Description Usage Arguments Value Note Author(s) Examples
Approximation of seasonal variation by a (possibly asymmetric) sine function
1 | seasonal(daynum, day1, day2, y1, y2)
|
daynum |
Day of the year (value in range 1:366). Can be a vector. |
day1 |
First day with fixed value, scalar. |
day2 |
Second day with fixed value, scalar. Must be > |
y1 |
Value at |
y2 |
Value at |
Numeric vector of the same length as daynum
.
A year is assumed to consist of 365 days. The result for day 366 is the
same as for day 365. See the example for how this function can be used with
values of class POSIXct
.
David Kneis david.kneis@tu-dresden.de
1 2 3 4 5 | # Lake temperature: min. of 3 degree C at day 20, max. 23 degree C at day 210
times= seq(from=ISOdatetime(2000,1,1,0,0,0),
to=ISOdatetime(2002,1,1,0,0,0), by=3600)
dayofyear= as.integer(format(times, "%j"))
plot(times, seasonal(dayofyear, 20, 210, 3, 23), type="l", ylab="Temperature")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.