Description Usage Arguments Details Value Author(s) See Also Examples
basis to make a function from a dataset
1 | funcfromdata(dat, xs, ys)
|
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. |
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.
a numeric value, representing the new y-value to the x-value givn by dat.
Florian Berger <florian_berger@ymail.com>
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.