Coder Social home page Coder Social logo

lay's People

Contributors

courtiol avatar romainfrancois avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lay's Issues

Clarify situation for slider

I am not sure why but slider (and only slider) shows very different speed whenever run in README vs in the vignette showing the benchmarks:

Vignette:
image

README:
image

@DavisVaughan, any idea why? I only discovered your great package right now and did not dig, but this is quite intriguing... Is it a compilation issue?

Alternative to iris?

It does not make much sense to do means and medians of different sepal dimensions.
We need a better example.
Use marketting data with multiple Q_r_ questions?

Pass fn arguments

It would be great if lay() could allow the passing of arguments.
I cannot get it work with a pmap() (hence no PR; forwarding the lay-level ... seems more tricky than I thought) but here is an apply()-based example:

    library(dplyr, warn.conflicts = FALSE)

    lay <- function(x, fun, ...) {
      fn <- rlang::as_function(fun)
      bits <- apply(x, 1, fn, ...)
      vctrs::vec_c(!!!bits)
    }

    iris <- as_tibble(iris)
    iris_na <- iris
    iris_na[1, 1] <- NA

    iris_na %>%
      mutate(sepal = lay(across(starts_with("Sepal")), median)) %>%
      slice_head(n = 2)
    #> # A tibble: 2 x 6
    #>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species sepal
    #>          <dbl>       <dbl>        <dbl>       <dbl> <fct>   <dbl>
    #> 1         NA           3.5          1.4         0.2 setosa  NA   
    #> 2          4.9         3            1.4         0.2 setosa   3.95

    iris_na %>%
      mutate(sepal = lay(across(starts_with("Sepal")), median, na.rm = TRUE)) %>%
      slice_head(n = 2)
    #> # A tibble: 2 x 6
    #>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species sepal
    #>          <dbl>       <dbl>        <dbl>       <dbl> <fct>   <dbl>
    #> 1         NA           3.5          1.4         0.2 setosa   3.5 
    #> 2          4.9         3            1.4         0.2 setosa   3.95

Need better hexsticker

We need to design a nice hexsticker... perhaps a hammock with a tibble sleeping in it?

Benchmark

I need benchmark to compare the performances of multiple rowwise alternatives.

Detect rowwise grouping

Users unfamiliar with lay may call rowwise() beforehand.
Doing so should exert no effect besides slowing down computation massively.
So perhaps we should detect rowwise groupings and act upon ithat (remove temporarily, warn, err, ...?).
That would probably imply to detect if the object is a tibble.
We need to see how this is efficiently done in dplyr.

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.