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

implement pillar::format_glimpse() for rvars #210

Closed
2 tasks done
mjskay opened this issue Nov 10, 2021 · 0 comments · Fixed by #213
Closed
2 tasks done

implement pillar::format_glimpse() for rvars #210

mjskay opened this issue Nov 10, 2021 · 0 comments · Fixed by #213

Comments

@mjskay
Copy link
Collaborator

mjskay commented Nov 10, 2021

Currently pillar::glimpse() fails if a data frame has an rvar in it:

> library(posterior)
> data.frame(x = rvar(1:10))
              x
1 5.5 ± 3.02765
> pillar::glimpse(data.frame(x = rvar(1:10)))
Rows: 1
Columns: 1
Error: C stack usage  15922912 is too close to the limit

This can be fixed by implementing pillar::format_glimpse(), which should be pretty easy. Basically:

  • if vector-like rvar, return character vector of elements converted to a display format. Some variant of format.rvar() should work
  • if array-like (2 or more dims), return an abbreviation similar to what matrices / arrays do; e.g. pillar::format_glimpse(matrix(1:10)) returns "<matrix[10 x 1]>"
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

Successfully merging a pull request may close this issue.

1 participant