Description Usage Arguments Value Author(s) See Also Examples

View source: R/detect.events.R

steps along a frequency contour and calculates the weighted distance between consecutive instants. if the weighted distance is > 1 then a new event begins

1 | ```
detect.events(X, var.weights)
``` |

`X` |
a data frame of frequency contour measurements |

`var.weights` |
the weights of the variables in X |

a factor of event ids, one for each instant

Benjamin N. Taft [email protected]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (X, var.weights)
{
events <- rep(1, nrow(X))
for (j in 1:ncol(X)) X[, j] <- X[, j] * var.weights[j]
for (i in 2:nrow(X)) {
events[i] <- events[i - 1]
delta <- sum((X[i, ] - X[i - 1, ])^2)
if (delta > 1)
events[i] <- events[i] + 1
}
return(invisible(events))
}
``` |

landmarkacoustics/SoundPoints-R documentation built on Sept. 26, 2018, 9:08 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.