Giter Club home page Giter Club logo

Comments (3)

sharlagelfand avatar sharlagelfand commented on May 21, 2024

These cases are solved in the refactor-test branch (original comment updated only to include cases that still don't work). Some of these animations are a bit hectic, but focus is on handling the logic properly and frames for each stage, rather than on the tweening itself

summarise without grouping

library(datamations)
library(dplyr)

datamation_sanddance("small_salary %>% summarize(mean = mean(Salary))")

summarize_without_group

grouping variable contains _

library(dplyr)
library(datamations)

small_salary_eg <- small_salary %>%
  mutate(highest_degree = Degree)

datamation_sanddance(
  pipeline = "small_salary_eg %>% group_by(highest_degree)",
)

underscore_in_variable

grouping variable value contains _

library(dplyr)
library(datamations)

small_salary_eg <- small_salary %>%
  mutate(degreework = paste0(Degree, "_", Work))

datamation_sanddance(
  pipeline = "small_salary_eg %>% group_by(degreework)")

underscore_in_value

and . case works too:

library(dplyr)
library(datamations)

small_salary_eg <- small_salary %>%
  mutate(degreework = paste0(Degree, ".", Work))

datamation_sanddance(
  pipeline = "small_salary_eg %>% group_by(degreework)")

period_in_value

no variation in a group's values (e.g. all the same, or only one value per group)

(mainly works because I've removed the error bars for now)

library(dplyr)
library(datamations)

datamation_sanddance("mtcars %>% group_by(carb, gear) %>% summarise(wt = mean(wt))")

no_variation

from datamations.

sharlagelfand avatar sharlagelfand commented on May 21, 2024

More cases that work now:

data contained in first verb rather than piped in

This is now supported. The data is parsed out and moved to the first position. Some tests for this as well.

library(datamations)

"small_salary %>% group_by(Degree) %>% summarize(mean = mean(Salary))" %>%
  parse_pipeline()
#> [[1]]
#> small_salary
#> 
#> [[2]]
#> group_by(Degree)
#> 
#> [[3]]
#> summarize(mean = mean(Salary))

"group_by(small_salary, Degree) %>% summarize(mean = mean(Salary))" %>%
  parse_pipeline()
#> [[1]]
#> small_salary
#> 
#> [[2]]
#> group_by(Degree)
#> 
#> [[3]]
#> summarize(mean = mean(Salary))

"group_by(palmerpenguins::penguins, Degree, Work) %>% summarize(mean = mean(bill_length_mm))" %>%
  parse_pipeline()
#> [[1]]
#> palmerpenguins::penguins
#> 
#> [[2]]
#> group_by(Degree, Work)
#> 
#> [[3]]
#> summarize(mean = mean(bill_length_mm))

more than 2 grouping variables

This is well supported now with the column facet -> row facet -> colour grouping flow. The output of datamations_sanddance() is just a list of vegalite pseudo-specs right now, but some tests demonstrating that this works.

from datamations.

sharlagelfand avatar sharlagelfand commented on May 21, 2024

The only thing left here is "summarizing more than 1 value" which seems more like an enhancement than a bug! So I'm going to open a new issue for that and close this off.

from datamations.

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.