BetaData: Creates abundance dataset from beta distribution

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

View source: R/BetaData.R

Description

Creates abundance dataset from beta distribution with given parameters.

Usage

1
BetaData(n, shape1, shape2, StartAndEnd, FillUp = TRUE)

Arguments

n

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

shape1

numeric; Parameter for underlying beta-distribution.

shape2

numeric; Parameter for underlying beta-distribution.

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.

FillUp

logical; If TRUE not specified datapoints will be filled with 0.

Details

Creates a data.frame, with two columns, one called dates and one called count. It will get n realizations of a beta distributions with the parameters given by shape 1 and shape 2.Those realizations will be converted, that the range of the realizations is no longer between zero and one, but the range between two dates that should be given by StartAndEnd. It will round those to whole numbers and convert them into dates, by treating these realizations as differences from the 2017-01-01. If fillup = TRUE it will fillup the dates that are in between the minimum and maximum of the dates, and give count values of zero for those days.

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  <- BetaData( shape1 = 5,shape2 = 1, n = 1000, StartAndEnd = c(0,15))
func <- as.function(estdist(dat))
curve(func, from = as.numeric(min(dat$Date)), to = as.numeric(max(dat$Date)))

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