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

Remove duplicated definitions of print/plot.multipanel #110

Merged
merged 4 commits into from
May 23, 2023

Conversation

stefaneng
Copy link
Contributor

Description

Removes copy-pasted block of code for print.multipanel.

Checklist

  • This PR does NOT contain PHI or germline genetic data. A repo may need to be deleted if such data is uploaded. Disclosing PHI is a major problem.

  • This PR does NOT contain molecular files, compressed files, output files such as images (e.g. .png, .jpeg), .pdf, .RData, .xlsx, .doc, .ppt, or other non-plain-text files. To automatically exclude such files using a .gitignore file, see here for example.

  • I have read the code review guidelines and the code review best practice on GitHub check-list.

  • I have set up or verified the main branch protection rule following the github standards before opening this pull request.

  • The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)]-[brief_description_of_branch].

  • I have added the major changes included in this pull request to the NEWS under the next release version or unreleased, and updated the date. I have also updated the version number in DESCRIPTION according to semantic versioning rules.

  • Both R CMD build and R CMD check run successfully.

@stefaneng stefaneng requested review from dan-knight and a team as code owners March 22, 2023 20:46
@@ -2,26 +2,17 @@
### This is needed because without it, the returned object is a grob which you must call grid.draw(x) on, this way, we can simply print the object.

print.multipanel <- function(x, ...) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am probably missing something but could we call the function plot.multipanel and remove L15?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want both plot and print methods to be defined though. The previous code just copy-pasted the definition twice so this only defines it once and uses the previous definition to assign to plot.multipanel. Perhaps more explicit is to write:

print.multipanel <- plot.multipanel <- function(x, ...) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Yes, your suggested code block makes more sense to me.

@dan-knight dan-knight merged commit 16c109e into main May 23, 2023
@dan-knight dan-knight deleted the stefaneng-simplify-multipanel-plot branch May 23, 2023 20:17
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