Skip to content

tibbles nested inside tibbles cause infinite recursion in repr_html #155

@michaelquinn32

Description

@michaelquinn32

Hi team!

Here's a reprex

library(repr)
library(tibble)

tbl_obj <- tibble::tibble(
  col1 = tibble::tibble(
    inner_col1 = 1
  )
)
repr::repr_html(tbl_obj)
Error: C stack usage  23918976 is too close to the limit
Execution halted

The issue is related to this line of code:

repr/R/utils.r

Line 162 in f4780e5

if (do_flatten) flatten(x[, start:end]) else x[, start:end]

I think the problem is indexing behaviors in tibbles vs data frames. A data frame will "drop" and return a vector if only one column is selected. tibbles don't do this by default. Setting drop = TRUE should fix it.

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