Skip to content

Conversation

@rich-iannone
Copy link
Member

This PR revises the tab_spanner() and tab_spanner_delim() functions so that there is no hard limit for only one level of spanner labels.

Fixes: #746

@rich-iannone rich-iannone requested a review from jcheng5 March 10, 2022 21:54
spanners_existing <-
spanners_existing %>%
dplyr::select(spanner_id, vars, spanner_level)
for (i in seq_len(nrow(spanners_tbl))) {
Copy link
Member

@jcheng5 jcheng5 Mar 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, take it or leave it:

highest_level <- spanners_tbl %>%
  dplyr::filter(vapply(vars, function(x) any(spanned_vars %in% x), logical(1))) %>%
  dplyr::pull("spanner_level") %>%
  max()

Copy link
Member Author

@rich-iannone rich-iannone Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to get this to work with the current tests in place. Could you make this a code suggestion? Perhaps I didn't integrate this correctly.

@jcheng5 jcheng5 self-requested a review March 11, 2022 20:46
@rich-iannone rich-iannone merged commit ec97f73 into master Mar 11, 2022
@rich-iannone rich-iannone deleted the extra-spanners branch March 11, 2022 21:32
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 this pull request may close these issues.

Feature request: Two or more levels of column spanners

3 participants