Skip to content

Assignment fails when conversion requires type change (R 4.0.0) #773

@pecanka

Description

@pecanka

Starting from R 4.0.0 (tested only on x64), an assignment into a column of a tibble filtered by rows fails when type conversion is required for instance from type logical to type integer, as in:

x = tibble(a=NA)
x[1,]$a = 2

The following error code is returned:

Error during wrapup: Assigned data `<tibble>` must be compatible with existing data.
i Error occurred for column `a`.
x Can't convert from <double> to <logical> due to loss of precision.
* Locations: 1.
Error: no more error handlers available (recursive errors?); invoking 'abort' restart

Without the filtering of rows there is no issue, the following works fine:

x = tibble(a=NA)
x$a = 2

In earlier versions of (e.g. R 3.6.2 x64) the code runs fine. Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorvctrs ↗️Requires vctrs package

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions