Skip to content

Added order and decr arguments to order bars according to their value…#8

Open
frareb wants to merge 3 commits into
r-gregmisc:developfrom
frareb:develop
Open

Added order and decr arguments to order bars according to their value…#8
frareb wants to merge 3 commits into
r-gregmisc:developfrom
frareb:develop

Conversation

@frareb

@frareb frareb commented Mar 26, 2020

Copy link
Copy Markdown

Hi,
This is a minor modification to the barplot2 function to sort/order bars within a column while keeping the colors. Thanks for your feedback and I hope it will be of general interest. You can test it with :
set.seed(1234)
dataset <- matrix(sample(1:20, 104/2, replace = TRUE), ncol = 13)
myCol <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A")
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13])
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13], order = TRUE, decr = TRUE)
barplot2(height = dataset, col = myCol, names.arg = LETTERS[1:13], order = TRUE, decr = FALSE)

@warnes warnes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks nice. Can you update the manual page in man/barplot2.Rd to include the new arguments and add your example?

@frareb

frareb commented Mar 30, 2020

Copy link
Copy Markdown
Author

I updated the manual page in man/barplot2.Rd. Thanks

@frareb
frareb requested a review from warnes July 3, 2020 10:22
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.

2 participants