[R] Custom annotation vector in R tsmp package

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Sat Mar 20 22:44:11 CET 2021


Please note, per the posting guide linked below:

"For questions about functions in standard packages distributed with R (see
the FAQ Add-on packages in R
<https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R>), ask
questions on R-help.
If the question relates to a *contributed package* , e.g., one downloaded
from CRAN, try contacting the package maintainer first. You can also use
find("functionname") and packageDescription("packagename") to find this
information [see also ?maintainer]. *Only* send such questions to R-help or
R-devel if you get no reply or need further assistance. This applies to
both requests for help and to bug reports."

So while you might get a response here, you should not expect one. Also, I
think it will be very difficult for anyone to help you without knowing what
"data" looks like. Could be wrong, of course...

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Mar 20, 2021 at 2:31 PM babelproofreader <babelproofreader using gmail.com>
wrote:

> 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]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list