[R] Custom annotation vector in R tsmp package

babelproofreader b@be|proo|re@der @end|ng |rom gm@||@com
Sat Mar 20 22:31:13 CET 2021


I'd like to use a custom annotation vector (av) for a matrix profile (mp)
produced using the tsmp package, but I am unsure how to amend said profile
produced by e.g. the compute function.

I note that the package provides some functions to do this for "standard"
cases, such as av_complexity, av_hardlimit_artifact etc. and then av_apply,
but I want to apply a custom av. I have tried directly replacing the mp in
the results produced by compute, i.e.

result <- compute( data , ... )
result$mp <- my_av_mp

but this doesn't work as I get the following error

Error in `[.data.frame`(matrix_profile$mp, min_idx) :
undefined columns selected

Trying

result$mp[,1] <- my_av_mp

doesn't give an error, but when I try to use the amended result further,
i.e.

motif_results <- find_motif( result , n_motifs = 5 , ... )

I get the error

Error in apply(.mp$mp, 2, which.min) : dim(X) must have a positive length

What is the correct way to apply a custom av with the tsmp package?

	[[alternative HTML version deleted]]



More information about the R-help mailing list