Learn R Programming

rucrdtw (version 0.1.6)

ucred_vv: UCR ED Algorithm vector-vector method

Description

Sliding-window similarity search using Euclidean Distance. This implementation of the UCR Suite Euclidean Distance command line utility takes an R numeric vector as data input and an R numeric vector for the query.

Usage

ucred_vv(data, query, skip = FALSE)

Value

a ucred object. A list with the following elements

  • location: The starting location of the nearest neighbor of the given query, of size length(query), in the data. Note that location starts from 1.

  • distance: The Euclidean Distance between the nearest neighbor and the query.

Arguments

data

numeric vector containing data

query

numeric vector containing query

skip

bool defaults to TRUE. If TRUE bound calculations and if necessary, distance calculations, are only performed on non-overlapping segments of the data (i.e. multiples of length(query)). This is useful if data is a set of multiple reference time series, each of length length(query). The location returned when skipping is the index of the subsequence.

Examples

Run this code
#read example file into vector
dataf <- scan(system.file("extdata/col_sc.txt", package="rucrdtw"))
#read example query file into vector
query <- scan(system.file("extdata/mid_sc.txt", package="rucrdtw"))
#run query
ucred_vv(dataf, query)

Run the code above in your browser using DataLab