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

Implement `geom_parallel_slopes()` #55

Merged
merged 6 commits into from Nov 3, 2019

Conversation

@echasnovski
Copy link
Contributor

@echasnovski echasnovski commented Nov 3, 2019

This PR implements a {ggplot2} layer function for fitting and plotting parallel slopes model. It is as similar to geom_smooth() as reasonably possible. It also has the ability to fit non-linear models (as shown in examples).

Closes #26.

echasnovski added 4 commits Nov 3, 2019
…e they are both redundant and currently have issues with different random generation algorithm.
@echasnovski
Copy link
Contributor Author

@echasnovski echasnovski commented Nov 3, 2019

I updated '.travis.yml' to not run {vdiffr} tests on old release. They are both redundant and currently have issues with different random generation algorithm. This is currently a problem because I set up tests for geom_parallel_slopes() with some random generation. If you want to preserve {vdiffr} tests on R old release, tell me and I'll redo tests with different (determenistic) example data set.

@codecov-io
Copy link

@codecov-io codecov-io commented Nov 3, 2019

Codecov Report

Merging #55 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #55   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      4    +1     
  Lines         148    186   +38     
=====================================
+ Hits          148    186   +38
Impacted Files Coverage Δ
R/geom_parallel_slopes.R 100% <100%> (ø)
Copy link
Member

@rudeboybert rudeboybert left a comment

Also, please add your name as package ctb and preferred contact method to DESCRIPTION

include:
- r: oldrel
# Don't use vdiffr on old R release
env: VDIFFR_RUN_TESTS=false

This comment has been minimized.

@rudeboybert

rudeboybert Nov 3, 2019
Member

interesting

#' output(s) to a \code{ggplot} object. Basically, it fits a unified model with
#' intercepts varying between groups (which should be supplied as standard
#' {ggplot2} grouping aesthetics: \code{group}, \code{color}, \code{fill},
#' etc.).

This comment has been minimized.

@rudeboybert

rudeboybert Nov 3, 2019
Member

Could you add a comment that this geom provides functionality that geom_smooth() doesn't?

#' ggplot_viz <- ggplot2::ggplot(
#' example_df,
#' ggplot2::aes(x = log10_size, y = log10_price, color = condition)
#' ) +

This comment has been minimized.

@rudeboybert

rudeboybert Nov 3, 2019
Member

After we merge we'll likely polish these a bit to make them more in line with the coding style we've been presenting to students in our intro courses. For example, we don't use dplyr:: but rather load the libraries

@rudeboybert
Copy link
Member

@rudeboybert rudeboybert commented Nov 3, 2019

Thanks a bunch! This really great work! Also, I just learned a lot about unit testing in this PR!

@rudeboybert rudeboybert merged commit 01c016d into moderndive:master Nov 3, 2019
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@echasnovski
Copy link
Contributor Author

@echasnovski echasnovski commented Nov 3, 2019

I am really glad this PR was and will be useful. Thank you for a challenging task 👍

@rudeboybert
Copy link
Member

@rudeboybert rudeboybert commented Nov 3, 2019

Thank you for doing it on such short notice! Everyone I've shown this to is already excited!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.