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

Collapse row labels into one column #129

Closed
6 tasks
mstackhouse opened this issue Jun 21, 2023 · 0 comments · Fixed by #163
Closed
6 tasks

Collapse row labels into one column #129

mstackhouse opened this issue Jun 21, 2023 · 0 comments · Fixed by #163
Assignees
Labels
enhancement New feature or request

Comments

@mstackhouse
Copy link
Contributor

Currently row labels output as separate variables, with the exception of nested count layers which can collapse the outer variable into the inner variable, and indent the inner variable's text.

Many organizations' standards collapse row labels into a single column. The basic flow there would be:

  • Grab the distinct set of row labels you want to nest as a dataframe, set a sort variable to 0
    • Preserve the sorting variable already available in Tplyr - so you actually might want to group by the row labes and then use like head(1) instead
  • From the original data frame, set that sort variable to 1
  • Stack them together
  • Create a new row label variable where you set the row labels together in one column and set the indentation
  • If more than 2 row labels, recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant