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

Automatic handling of missing values #24

Closed
christophscheuch opened this issue Sep 5, 2023 · 1 comment
Closed

Automatic handling of missing values #24

christophscheuch opened this issue Sep 5, 2023 · 1 comment

Comments

@christophscheuch
Copy link

For those stats which require complete data, missing values will be automatically removed with a warning in ´ggplot2´ (see here for the corresponding convenience function). The Python library plotnine also removes missing values with a warning. When I started creating plots with TidierPlots, I was confused by the axis labels until I realized that it automatically adds a missing category to the labels.

Here is a specific example:

using Tidier, PalmerPenguins

penguins = DataFrame(PalmerPenguins.load())

# Creating a plot without dropping missing variables leads to messed up axis labels
@ggplot(penguins, aes(x = bill_length_mm, y = bill_depth_mm)) +
  @geom_point()

# Dropping missing values from aes variables leads to proper labels
penguins_sub = @drop_na(penguins, bill_length_mm, bill_depth_mm)
@ggplot(penguins_sub, aes(x = bill_length_mm, y = bill_depth_mm)) +
  @geom_point()

Is this desired behavior or do we also want to have automatic handling of missing values eventually?

@rdboyes
Copy link
Member

rdboyes commented Sep 21, 2023

fixed in 2c45592

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

No branches or pull requests

2 participants