-
Notifications
You must be signed in to change notification settings - Fork 54
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
shape mapping Object ..missing.. not found #290
Comments
I haven't been able to get my head around how ## using above construction
ggplot(data = data, mapping = aes(.data$m2.price, .data$surface, shape = .data$no.rooms)) +
stat_miss_point() ## using construction in #137
mydat <- mtcars
mydat$mpg[1:10] = NA
ggplot(mydat, aes(x = mpg, y = disp, shape = factor(cyl))) +
stat_miss_point(size = 4) Is there any reason one shouldn't do this? Additionally, when the aesthetic variable is missing there's an additional layer of 'missingness' to deal with and I wonder if that should be handled by making 'missing' a new level of that scale? |
I think that is a good idea, actually the convention recommended when you have a missng value for a categorical variable. Encode it as an additional category.
On 21 Sep 2021, at 11:41 am, Jonathan Carroll ***@***.***> wrote:
I haven't been able to get my head around how ggproto works enough to offer any suggestions for how to fix this, but a workaround might be to use stat_miss_point() which seems to work as a drop-in replacement, at least for the above example and others I tried (whether that's right or wrong is beyond my knowledge)
## using above construction
ggplot(
data = data, mapping = aes(.data$m2.price, .data$surface, shape = .data$no.rooms)) +
stat_miss_point()
## using construction in #137
mydat <- mtcars
mydat$mpg[1:10] = NA
ggplot(
mydat, aes(x = mpg, y = disp, shape = factor(cyl))) +
stat_miss_point(
size = 4)
Is there any reason one shouldn't do this?
Additionally, when the aesthetic variable is missing there's an additional layer of 'missingness' to deal with and I wonder if that should be handled by making 'missing' a new level of that scale?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
cheers,
Di
…---
Dianne Cook
***@***.***
|
Thank you @jonocarroll and @maksymiuks ! This has been closed in #293 |
Hi!
First of all thank you for your amazing job under this package. I consider it great and love to see how it develops. I have one slight issue to consult though and I probably need a hand with that. It is slightly related to the issue #137. To cut long story short mapping works perfectly for color as you can see below but it fails for shape with an error Object ..missing.. not found (in English version may be slightly different, I translated it myself from my local). Do you have any idea what caused that? Use case of mine is that color mapping is not specified (desired is default one) while the shape is specified and second use case is when both are specified. Do you have any idea what might have causedd a problem?
Best
Szymon
Created on 2021-09-03 by the reprex package (v2.0.1)
Additionally, I have one small question. Is it possible to make elements in ..missing. (when using geom with default settings) a factor with
Missing
andNot Missing
levels? That way they will be always of the same color instead of swapping colors depending on if the data have or don't have missing values. It is really confusing.The text was updated successfully, but these errors were encountered: