NormDataDates: Creates abundance dataset for given time-range

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/NormDataDates.R

Description

Creates abundance dataset for given time-range from normal distribution.

Usage

1
NormDataDates(StartAndEnd, sd, n = 1000)

Arguments

sd

numeric; standard deviation of the underlying normal distribution.

n

numeric, whole number; number of drawings to be done from the normal distribution, also the number of observations in the whole dataset.

startandend

vector; Start and end values in which the dates will be. If those are not date objects, they will be interpreted as difference from the 01-01-1970.

Details

Will produce a dataset with two columns, one named dates, that will be filled with dates, and one called count with full numbers. It will get n realizations from a normal distribution with given sd. Those realizations will be converted, so that they lie between the dates given by StartAndEnd. this will be done, by calculating the distance to some dates, that are equally distributed between the maximum and minimum value of the realizations. There will be as many dates as there are days in the range of StartAndEnd, so those represent the actual dates. The count values for those days will be calculated by the number of realizations that have their minimum distance to the respective date. In the end these constructed dates will be converted, so that they lie in between StartAndEnd.

Value

a dataframe with two columns; one with date objects, one with the number of observations on the respective dates.

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
2
3
dat  <- NormDataDates( sd = 30, n = 1000, StartAndEnd = c(0,15))
func <- as.function(estdist(dat))
curve(func, from = min(dat$Date), to = max(dat$Date))

biometry/phenologicalOverlap documentation built on May 21, 2019, 2:31 a.m.