Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kpagacz opened this issue Aug 3, 2021 · 2 comments

Comments

@kpagacz
Copy link

kpagacz commented Aug 3, 2021

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

@kpagacz
Copy link
Author

kpagacz commented Aug 3, 2021

As a bonus: there's a typo in the doc string:
image

empty string, not sting

gmbecker added a commit to insightsengineering/formatters that referenced this issue Jun 14, 2022
@gmbecker
Copy link
Collaborator

Closed as fixed by above commit to formatters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants