Skip to content

[R] Implement is.type() functions for dplyr #28520

@asfimport

Description

@asfimport

Define functions in nse_funcs for all the important base R generic is.type() functions, including:

  • is.numeric()

  • is.double()

  • is.integer()

  • is.integer64()

  • is.character()

  • is.logical()

    Maybe also:

  • is.factor() # TRUE for dictionary types

  • is.ordered() # TRUE for ordered dictionary types

  • is.list() # TRUE for ListArrays

    I think the easiest way to implement this would be to check $type_id() against the Type enum values, for example:

    array$type_id() %in% Type[c("UINT8", "INT8", ...)]

    For this to work the same way on unevaluated Expression columns in arrow_dplyr_query objects, add a public function type_id() to the Expression R6 class like this:

    type_id = function(schema) compute___expr__type(self, schema)$id,

Reporter: Ian Cook / @ianmcook
Assignee: Ian Cook / @ianmcook

Related issues:

PRs and other links:

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions