morenococo / crqa

Cross-recurrence quantification analysis of two time-series, of either categorical or continuous values. It provides different methods for profiling cross-recurrence, i.e., only looking at the diagonal recurrent points, as well as more in-depth measures of the whole cross-recurrence plot, e.g., recurrence rate.
9 stars 1 forks source link

Improved parsing and checking of function parameters in crqa() #6

Closed danm0nster closed 4 months ago

danm0nster commented 6 months ago

In some cases it is possible to pass an invalid option to crqa(), but the function will happily run and return output without any warnings or errors.

Example:

ts <- rnorm(100)
rqa_result <- crqa(ts, ts, method = "does not exist")

We need to parse the input more carefully and produce a warning or error, when something is not as expected.

Note: This kind of error can be potentially disastrous if a user mistypes a valid method, because then it is unclear what the function actually does.

morenococo commented 6 months ago

thanks for spotting this. Indeed it is a key issue to fix I will directly check it and amend it in the next release of the package.

morenococo commented 6 months ago

@danm0nster I fixed this by simply checking that the method exists; otherwise, it stops. I will update this once we gather another couple of the open issues solved.

morenococo commented 4 months ago

I included a check for "method", so this issue will not happen anymore