Skip to content

breakpoints: error deep in the stack when h > 1 and not integer #5

@GreatEmerald

Description

@GreatEmerald

If breakpoints() is given e.g. h=365.25/16, it breaks down with an error on this line: https://github.com/appelmar/strucchange/blob/78d57129b45c0c5cf28cc69a3b19956ee0ac2486/R/breakpoints.R#L266
It assumes that "index" and "my.index" are integers, but in fact they are floats in this case, and the two variables are offset from one another, causing an error as as.character(i) matches no indices.

Either the function should stop with an error early stating that h should be integer (that is what is stated in the help file), or it should give a warning and round the h to the nearest integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions