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

Feature ppc ribbon obspoints #257

Merged
merged 7 commits into from
Feb 22, 2021
Merged

Feature ppc ribbon obspoints #257

merged 7 commits into from
Feb 22, 2021

Conversation

charlesm93
Copy link
Contributor

Addresses issue #256

Add an additional argument, y_draw, for ppc_ribbon and ppc_ribbon_grouped which specifies whether the observed y should be plotted using a point, line, or both.

While at it, add unit tests for ppc_ribbon_grouped, emulating what's be done for ppc_intervals_grouped.

@charlesm93
Copy link
Contributor Author

@jgabry can you review? Thank you!

@charlesm93
Copy link
Contributor Author

This PR may have been a bit premature. What's the documentation policy? Is a standard manual that needs to be updated? What about the vignettes, should some get added?

I'm not sure why the tests fail. It seems to be related to installing dependencies.

@jgabry
Copy link
Member

jgabry commented Jan 19, 2021

Hey Charles, really sorry for the delay on this. I just pushed a few commits fixing a few things, but this looks good. I'll add some review comments pointing out the changes.

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the small changes I pushed let's see if all the checks pass now. But this looks good to me!

Comment on lines 176 to 177
#' @param y_draw For ribbon plots only, a string specifying how to draw `y. Can
#' be `"line"` (the default), `"points"`, or `"both"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One reason CI was failing was because of a missing doc entry for the y_draw argument. I added that here.

ppc_ribbon <- function(y,
yrep,
x = NULL,
...,
prob = 0.5,
prob_outer = 0.9,
alpha = 0.33,
size = 0.25) {
size = 0.25,
y_draw = c("line", "points", "both")) {
Copy link
Member

@jgabry jgabry Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not essential, but it's common in R to put all valid options in a vector and then use match.arg later to ensure that what the user wrote is a valid option. (See below where I added match.arg)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I was wondering what match.arg does.


style <- match.arg(style)
y_draw <- match.arg(y_draw)
Copy link
Member

@jgabry jgabry Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because the match.arg function will result in an error if the user's y_draw argument isn't one of the three valid ones.

@codecov-io
Copy link

codecov-io commented Jan 20, 2021

Codecov Report

Merging #257 (3169902) into master (293bf4b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #257   +/-   ##
=======================================
  Coverage   98.35%   98.36%           
=======================================
  Files          32       32           
  Lines        4146     4155    +9     
=======================================
+ Hits         4078     4087    +9     
  Misses         68       68           
Impacted Files Coverage Δ
R/ppc-intervals.R 99.39% <100.00%> (+0.03%) ⬆️
R/ppc-censoring.R 95.23% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 293bf4b...3169902. Read the comment docs.

@charlesm93
Copy link
Contributor Author

@jgabry All the changes you made look good to me. Looks like we still have one failing tests, concerning the vignettes. I don't believe I made any changes to those, but if something needs fixing, I can get to it.

@jgabry
Copy link
Member

jgabry commented Feb 22, 2021

The one failing check is unrelated to this PR, so I'm going to go ahead and merge. Sorry for the delay!

@jgabry jgabry merged commit ecb1676 into master Feb 22, 2021
@jgabry jgabry deleted the feature-ppc_ribbon_obspoints branch May 24, 2021 20:52
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

Successfully merging this pull request may close these issues.

3 participants