Skip to content

In summarise draws, a function that returns a character changes all columns to character #355

@n-kall

Description

@n-kall

If a summary function that returns a character is used in summarise_draws, it makes all columns <chr> which messes up formatting.

example_draws() |>
   summarise_draws(char_fun = \(x) "word", mean)

Returns

# A tibble: 10 × 3
   variable char_fun      mean
   <chr>    <chr>         <chr>
 1 mu       word          4.1799990610081
 2 tau      word          4.16356885610418
 3 theta[1] word          6.74893947963962
 4 theta[2] word          5.25331634990726
 5 theta[3] word          3.04393475572924
 6 theta[4] word          4.85842854299997
 7 theta[5] word          3.22258991784476
 8 theta[6] word          3.98696993634695
 9 theta[7] word          6.5030995214442
10 theta[8] word          4.56520199862817

This could be fixed by using type.convert(out, as.is = TRUE) on the output tibble in summarise_draws_helper

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions