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

pch + by #5

Merged
merged 2 commits into from
Apr 8, 2023
Merged

pch + by #5

merged 2 commits into from
Apr 8, 2023

Conversation

vincentarelbundock
Copy link
Collaborator

This PR implements the @zeileis suggestion to make pch a bit smarter when using the by argument. See #4 (comment)

I could easily do something similar for col if you think this is something you would eventually want to merge.

library(plot2)

# default
with(mtcars, plot2(mpg ~ hp | gear))

# manual shape: vector must be same length as number of groups
with(mtcars, plot2(mpg ~ hp | gear, pch = 2:4))

# user input sanity check
with(mtcars, plot2(mpg ~ hp | gear, pch = 1:32))
# Error: `pch` must be `NULL` or a vector of length 1 or 3.

@grantmcdermott
Copy link
Owner

Dig it. Thanks @vincentarelbundock, please add your name as a contributor in the DESCRIPTION and I'll look to merge.

(As an aside, I still need to add the tinysnapshot testing scaffolding but will try to do that when I get a sec today.)

@grantmcdermott grantmcdermott merged commit c574e8f into grantmcdermott:main Apr 8, 2023
5 checks passed
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.

None yet

2 participants