ArchaeoStat/ArchaeoPhases

plot chronomodel phases

Closed this issue · 6 comments

tsdye commented

Describe the bug
I get an error message when trying to plot chronomodel phases with succession = "hiatus"

. + > . + Error in graphics::rect(xleft = hia$start, xright = hia$end, ybottom = min(ylim), :
cannot mix zero-length and non-zero-length coordinates

This is with the current code here at ArchaeoStat/ArchaeoPhases.

To Reproduce
. path_phases <- "/home/dk/Projects/hanamiai/data/chronomodel/mqs_final_htt/Chain_all_Phases.csv"
mqs_phases <- ArchaeoPhases::read_chronomodel_phases(path_phases)
mqs_phase_boundaries <- ArchaeoPhases::boundaries(mqs_phases, level = 0.95)
plot(mqs_phases[, c("Hoʻoumi A/B", "Hoʻoumi D"), ], succession = "hiatus")

I can send Chain_all_Phases.csv if you like. It is 31Mb file.

Expected behavior
A plot similar to the one shown for Ksar Akil, which reproduces without error here.

@tsdye It could be an dependency issue. ArchaeoPhases uses aion, which is in the final phase of development. I've made some changes recently in aion that could be at the root of your problem.

Could you try reinstalling ArchaeoPhases and aion and tell me if it's OK?

remove.packages("ArchaeoPhases", "aion")
remotes::install_github("tesselle/aion")
remotes::install_github("ArchaeoStat/ArchaeoPhases")
tsdye commented

@nfrerebeau Before, there was an empty plot. Now, there is no plot and the error message is changed:
> > > Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'plot': error in evaluating a 'primitive' next method: subscript out of bounds

I may have fixed it now 🤞. Could you reinstall ArchaeoPhases and try again?

remove.packages("ArchaeoPhases")
remotes::install_github("tesselle/aion")
tsdye commented

@nfrerebeau I still get an error:
Error in graphics::rect(xleft = hia$start, xright = hia$end, ybottom = min(ylim), : cannot mix zero-length and non-zero-length coordinates

Also, the changed error message I sent earlier is due to user error, and not to changes in ArchaeoPhases. Sorry for the noise.

@tsdye I think I've found the problem. It must have something to do with the fact that there's no hiatus between your two phases (?). If that's the case, plot() will now returns a warning.

tsdye commented

@nfrerebeau That is the case.

Warning message:
Could not find a hiatus between these two phases. 

Thanks for tracking this down and fixing it.