Skip to content

rtables::var_labels throws an error instead of an empty string for an empty data.frame #224

@kpagacz

Description

@kpagacz

According to the doc string of rtables::var_labels rtables::var_labels returns a named character vector with the variable labels (empty string if not specified), but it returns an error if passed an empty data.frame(). I would expect it to return a character vector of length 0 because an empty data.frame is a valid data.frame with 0 columns and has no variable labels specified.

rtables::var_labels(data.frame()) # throws an error

image

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