Git Product home page Git Product logo

Comments (5)

mine-cetinkaya-rundel avatar mine-cetinkaya-rundel commented on May 23, 2024 2

@linshhhhh you can set geom_waffle(na.rm = TRUE) or geom_waffle(na.rm = FALSE) explicitly and it should work.

from waffle.

hrbrmstr avatar hrbrmstr commented on May 23, 2024 2

fixed in latest GH and now CRAN release. #ty

from waffle.

linshhhhh avatar linshhhhh commented on May 23, 2024

Hi! I just encountered the same problem. It gives an error in remove_missing(): because "na.rm must be TRUE or FALSE, not NA". Have you figured out the solution to this error? Thank you in advance!

from waffle.

linshhhhh avatar linshhhhh commented on May 23, 2024

Thank you so much for your help. It works finally!

from waffle.

AnttiRask avatar AnttiRask commented on May 23, 2024

To recreate the exact sample plot, this is the complete code. If someone would like to update the documentation with these.

library(dplyr)
library(waffle)

storms_df <- storms %>% 
    filter(
        status %in% c("tropical storm", "tropical depression", "hurricane"),
        between(year, 2010, 2015)
    ) %>% 
    count(year, status)

storms_df %>% 
    ggplot(aes(fill = status, values = n)) +
    geom_waffle(
        color  = "white",
        size   = .25,
        n_rows = 10,
        flip   = TRUE,
        na.rm  = TRUE
    ) +
    facet_wrap(~year, nrow = 1, strip.position = "bottom") +
    scale_x_discrete() + 
    scale_y_continuous(labels = function(x) x * 10, # make this multiplyer the same as n_rows
                       expand = c(0,0)) +
    ggthemes::scale_fill_tableau(name=NULL) +
    coord_equal() +
    labs(
        title = "Faceted Waffle Bar Chart",
        subtitle = "{dplyr} storms data",
        x = "Year",
        y = "Count"
    ) +
    theme_minimal(base_family = "Roboto Condensed") +
    theme(panel.grid = element_blank(), axis.ticks.y = element_line()) +
    guides(fill = guide_legend(reverse = TRUE))

from waffle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.