Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: supplied y elements corresponding to NA x must be dropped if use.points = TRUE #5

Open
MichaelChirico opened this issue May 21, 2018 · 1 comment

Comments

@MichaelChirico
Copy link
Contributor

MRE:

x = Intervals(cbind(c(0, NA), c(1, NA)))
plot(x, 1:2)
# Error in xy.coords(x, y) : 'x' and 'y' lengths differ
@MichaelChirico
Copy link
Contributor Author

I think this will fix the problem, can't test at the moment:

  if ( is.null(xlim) ) {
    xlim <- range( [email protected] )
    drop_idx = is.na( x )
  }
  else 
    drop_idx = is.na( x ) | x[ , 2L] < xlim[1L] | x[ , 1L] > xlim[1L]

  x = x[!drop_idx, ]
  
  if ( is.null(y) )
    y <- .Call( "_plot_overlap", [email protected], closed(x), is( x, "Intervals_full" ) )
  else y <- y[!drop_idx]

@MichaelChirico MichaelChirico changed the title Bug: y elements corresponding to NA x must be dropped if use.points = TRUE Bug: supplied y elements corresponding to NA x must be dropped if use.points = TRUE May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant