Skip to content

[Bug]: report fails when a character vector has only one unique value #578

@HywelMJ

Description

@HywelMJ

Describe the bug

report fails when a character vector has only one unique value with

Error in names(n_char) <- c("Entry", "n_Entry") :
'names' attribute [2] must be the same length as the vector [1]

Reproducible example

library(report)
packageVersion("report")
single_char_vector <- c("big")
df <- data.frame("id" = 1:6, "size" = single_char_vector)
report(df)

Session Info

R version 4.5.1 (2025-06-13 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default
LAPACK version 3.12.1

locale:

[1] LC_COLLATE=Welsh_United Kingdom.utf8 LC_CTYPE=Welsh_United Kingdom.utf8
[3] LC_MONETARY=Welsh_United Kingdom.utf8 LC_NUMERIC=C
[5] LC_TIME=Welsh_United Kingdom.utf8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] report_0.6.1

loaded via a namespace (and not attached):
[1] compiler_4.5.1 tools_4.5.1 datawizard_1.2.0 rstudioapi_0.17.1 insight_1.4.2

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions