Skip to content

hiatus bug triggered by level #24

@tsdye

Description

@tsdye

Describe the bug
A clear and concise description of what the bug is.

hiatus returns an error at a one level, but exits correctly with a slightly different level.

To Reproduce
A minimal reproducible example (AKA a reprex).

hiatus(eve, level=0.950)

Error in if (p[2, i] == p[1, i]) return(no_hiatus) : 
  the condition has length > 1

hiatus(eve, level=0.949)

|                                         |   start |     end |         duration |
|-----------------------------------------+---------+---------+------------------|
| Austral Islands settlement-Paleotsunami | 1177.91 | 1423.34 | 246.427260273972 |

hiatus(eve, level=0.951)

|                                         |      start |              end |         duration |
|-----------------------------------------+------------+------------------+------------------|
| Austral Islands settlement-Paleotsunami | 1178.58041 | 1423.33991657977 | 245.756766853743 |

Expected behavior
A clear and concise description of what you expected to happen.

All levels should exit correctly.

Test output
Output of tinytest::test_package("ArchaeoPhases")
tinytest::test_package("ArchaeoPhases")
test_activity.R............... 2 tests OK 0.3s
test_allen.R.................. 11 tests OK 15ms
test_boundaries.R............. 1 tests OK 0.2s
test_events.R................. 1 tests OK 30ms
test_hiatus.R................. 2 tests OK 0.2s
test_interval.R............... 4 tests OK 93ms
test_occurrence.R............. 1 tests OK 58ms
test_older.R.................. 2 tests OK 26ms
test_phases.R................. 2 tests OK 0.2s
test_summary.R................ 2 tests OK 0.2s
test_tempo.R.................. 1 tests OK 0.2s
test_transition.R............. 1 tests OK 68ms
All ok, 30 results (1.7s)

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

This bug is also present in ArchaeoPhases 1.8.
I can send the eve data, if need be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions