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

Forcefully color NAs when aes(color=NULL) or aes(...), ..., color="salmon") is provided and remove_nas=F #10

Open
matiasandina opened this issue Nov 13, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@matiasandina
Copy link
Owner

matiasandina commented Nov 13, 2022

I believe that something like this:

ggplot(wombats, aes(x=frame, behaviour=behaviour, y=wombat)) + geom_ethogram(remove_nas = F)

Should return this

image

But the NAs should be forcefully colored in gray. Maybe this is one of the things that could be handled by setup_data #8 ?

@matiasandina matiasandina added the enhancement New feature or request label Nov 13, 2022
@matiasandina
Copy link
Owner Author

matiasandina commented Feb 24, 2023

I think we can do this here

ggethos/R/ggethos.R

Lines 108 to 110 in 2fd669c

if (remove_nas) {
data <- data[which(!is.na(data$behaviour)),]
}

Something like

if (remove_nas) {
  ...
}
else{
data <- mutate(data, colour=ifelse(is.na(colour), "gray50", colour))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant