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

plot_sf() error with shifthd_pbci() output #7

Closed
hsteptoe opened this issue Jul 17, 2019 · 2 comments
Closed

plot_sf() error with shifthd_pbci() output #7

hsteptoe opened this issue Jul 17, 2019 · 2 comments

Comments

@hsteptoe
Copy link
Contributor

Related to #4 and #6, the plot_sf() error still seems to exist when used with shifthd_pbci(). I'm not exactly clear what the outcome of #4 and #6 where, so starting a new issue for clarity.

The error can be reproduced with:

library(rogme)
library(ggplot2)

#> generate data
set.seed(21)
g1 <- rnorm(1000) + 6
g2 <- rnorm(1000) * 1.5 + 6

#> make tibble
df <- mkt2(g1, g2)

#> compute shift function
# sf <- shifthd(data = df, formula = obs ~ gr, nboot = 200)
sf <- shifthd_pbci(data = df, formula = obs ~ gr, nboot = 200, q = c(.1,.25,.5,.75,.9))

#> plot shift function
psf <- plot_sf(sf, plot_theme = 1)

and returns an error:

Error in if (all.equal(df$q, seq(0.1, 0.9, 0.1))) { : 
  argument is not interpretable as logical

Coincidentally, using sf in plot_hd_links() works fine.

@GRousselet
Copy link
Owner

Hi,
I've added isTRUE to that logical statement, which seems to fix the problem.
Let me know if it works for you.
Thanks for reporting the bug.

@hsteptoe
Copy link
Contributor Author

hsteptoe commented Aug 6, 2019

Yep, this works for me. Thanks for the fix!

@hsteptoe hsteptoe closed this as completed Aug 6, 2019
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

2 participants