Skip to content

'unknown or uninitialised column' warning is annoying #450

@kevinushey

Description

@kevinushey

It's very common to check if a list element exists with code of the form:

is.null(l$x)

But doing so with a tibble emits warnings:

library(tibble)
options(warn = 1)
tbl <- tibble(a = 1)
is.null(tbl$c)
#> Warning: Unknown or uninitialised column: 'c'.
#> [1] TRUE

This sort of thing can happen when writing generic code that accepts all list-like R objects (of which tibbles are one).

See also: https://community.rstudio.com/t/bug-report-unknown-column-warning-when-using-tibbles/12246

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions