OLE.weitzman: calculates Weitzman's Delta

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

View source: R/OLE-weitzman.R

Description

calculates Weitzman's Delta from two datasets

Usage

1
2
OLE.weitzman(data1, data2, datapoints = NULL, addtoplot = FALSE,
  consider = "both", CheckData = TRUE, Interpolate = TRUE)

Arguments

data1

list: like returned by either the estdist() and uniform() functions (only if CheckData = TRUE) or by the kernelest() and normalize() function.

data2

list: like returned by either the estdist() and uniform() functions (only if CheckData = TRUE) or by the kernelest() and normalize() function.

datapoints

numeric (whole numbers); will be passed as funcdatapoints-argument to the EstimatorData() Function and so represents the amount of datapoints which shall be drawn from an possible input function .

addtoplot

logical; if TRUE an lines() function will be called which illustrates the outcome. (actually the Weitzman's Delta is the area under this line)

consider

string; can either be : 'both', 'data1' or 'data2'. If both Weitzman's Delta will be calculated as usual, if it os data1 it will calculate the Integral of data1 in the range where both datasets overlap. Accordingly for 'data2'.

CheckData

logical; If TRUE the EstimatorData() function will be runned in advance.

Interpolate

logical; will be passed to EstimatorData() function.

Details

calculates Weitzman's Delta from two datasets, a dataset should be a list which contains either a function (only if CheckData = TRUE) or a data.frame which represents the corresponding probability density function. If CheckData is set False it will go through all the points in the datasets and will not treat it as continous data, meaning, that if the datasets do not share the same points, the result may be calculated wrong. If DataCheck is set TRUE it will run data processing in advance with the EstimatorData() function.

Value

numeric value representing Weitzman's Delta.

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Create Datasets
 a     <- c(1:10)
 dates1 <- as.Date(a, origin = '2017-01-01')
 count1 <- c(1,1,3,4,6,9,5,4,2,1)
 dat1   <- data.frame(dates1, count1)
 b     <- c(6:15)
 dates2 <- as.Date(b, origin = '2017-01-01')
 count2 <- c(1,2,4,5,6,9,3,4,1,1)
 dat2   <- data.frame(dates2, count2)
 
 #Calculate corresponding probability densities
 a1 <- estdistr(dat1, returnonlyfunction = FALSE)
 b1 <- kernelest(dat2)
 
 #Calculate Weitzman's Delta
 OLE.weitzman(a1,b1)

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