funcfromdata: basis to make a function from a dataset

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

View source: R/funcfromdata.R

Description

basis to make a function from a dataset

Usage

1
funcfromdata(dat, xs, ys)

Arguments

dat

numeric; X value for which a y-value shall be calculated by interpolating the data.

xs

vector; vector of numeric values, 'x'component of dataset. In combination with ys this makes a dataset.

ys

vector; vector of numeric values, 'y'component of dataset. In combination with xs this makes a dataset.

Details

basis for creating a function from data, xs and ys is the basis for the calculation, so the function will return the interpolated y value to the x-value that is given by dat. the function will return 0 for Every value for dat, that is not in between the minimum and the maximum of xs.

Value

a numeric value, representing the new y-value to the x-value givn by dat.

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
2
3
4
dat  <- BetaData( shape1 = 5,shape2 = 1, n = 1000, StartAndEnd = c(0,15))
func <- function(x)funcfromdata(x, xs = as.numeric(dat$Date), y = dat$Count)
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.