Skip to content

[R] arrow_eval user-defined generic functions  #33156

@asfimport

Description

@asfimport

ARROW-14071 and ARROW-16444 cover evaluating user-defined functions in different ways, but could we extend this behaviour so it be possible to evaluate generics? Here's an example of how that works in dplyr from a Stack Overflow question:

library(dplyr)

df <- data.frame(a = c("these", "are", "some", "strings"),
                 b = 1:4)

boop <- function(x, ...) UseMethod("boop", x)

boop.numeric <- function(x) mean(x, na.rm = TRUE)

boop.character <- function(x) mean(nchar(x), na.rm =TRUE )

df %>% summarise(across(everything(), boop))

Reporter: Nicola Crane / @thisisnic

Related issues:

Note: This issue was originally created as ARROW-17948. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions