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

create.violinplot: add panel arguments like in create.scatterplot #188

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jarbet
Copy link
Contributor

@jarbet jarbet commented Aug 9, 2024

Description

Add panel arguments to create.violinplot that are also used in create.scatterplot, create.boxplot. See Tests below for examples.

Closes #186

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.

Testing Results

# To get reprex() to work, need to give root path of BPG to devtools::load_all()
suppressPackageStartupMessages(devtools::load_all('/Users/jarbet/Documents/git/public-R-BoutrosLab-plotting-general'));
#> ℹ Loading BoutrosLab.plotting.general

data(mtcars);
mtcars$am <- factor(
    x = mtcars$am,
    levels = c(1, 0),
    labels = c('yes', 'no')
    );

# default
create.violinplot(
    formula = mpg ~ vs | am,
    data = mtcars
    );

# changing the new arguments
create.violinplot(
    formula = mpg ~ vs | am,
    data = mtcars,
    strip.cex = 3,
    strip.fontface = 4,
    layout = c(1,2),
    strip.col = 'lightblue'
    )

Created on 2024-08-09 with reprex v2.0.2

@dan-knight
Copy link
Contributor

Sorry if I'm missing it, but where is disable.factor.sorting actually used? I'm looking for something like this in create.boxplot().

@jarbet jarbet closed this Aug 9, 2024
@jarbet
Copy link
Contributor Author

jarbet commented Aug 9, 2024

Sorry for accidentally closing the PR.

@dan-knight : I'm not sure, but this issue/PR is not related to disable.factor.sorting

@jarbet jarbet reopened this Aug 9, 2024
@dan-knight
Copy link
Contributor

this issue/PR is not related to disable.factor.sorting

Ah, it must've just showed up in the changes alongside your actual changes. Sorry about the confusion.

@@ -25,7 +25,8 @@ create.violinplot <- function(
xleft.rectangle = NULL, ybottom.rectangle = NULL, xright.rectangle = NULL, ytop.rectangle = NULL,
col.rectangle = 'transparent', alpha.rectangle = 1, height = 6, width = 6, resolution = 1600,
size.units = 'in', enable.warnings = FALSE, description = 'Created with BoutrosLab.plotting.general',
style = 'BoutrosLab', preload.default = 'custom', use.legacy.settings = FALSE, disable.factor.sorting = FALSE
style = 'BoutrosLab', preload.default = 'custom', use.legacy.settings = FALSE, disable.factor.sorting = FALSE,
strip.col = 'white', strip.cex = 1, strip.fontface = 'bold', layout = NULL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dan-knight : the new parameters are strip.col, strip.cex, strip.fontface, layout - all used in create.scatterplot and create.boxplot

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.

create.violinplot missing strip.cex argument?
2 participants