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

nlines is user-facing but it does not work on general tables #119

Open
Melkiades opened this issue Mar 8, 2023 · 2 comments
Open

nlines is user-facing but it does not work on general tables #119

Melkiades opened this issue Mar 8, 2023 · 2 comments
Labels
discussion Needs to consider if worth it or how enhancement New feature or request question Further information is requested sme Tracks changes for the sme board

Comments

@Melkiades
Copy link
Contributor

Melkiades commented Mar 8, 2023

I was trying to get the global number of lines without having to get nlheader from matrix_form. So, I guess, the first question is the following: is there a function to find the total number of lines? if yes, we should document it in rtables::nrow. See here for a follow-up on this. If not, we should have one and intuitively I was searching for rtables::nlines but maybe too a specific variable in nrow like this rtables::nrow(..., with_header = T). Let me know what you think @gmbecker

@Melkiades Melkiades added enhancement New feature or request question Further information is requested discussion Needs to consider if worth it or how sme Tracks changes for the sme board labels Mar 8, 2023
@gmbecker
Copy link
Collaborator

gmbecker commented Mar 8, 2023

header materials are not rows, so I don't think we should have an option to have them "taken into account" via nrow.

Note also that nrow does not (and will not ever) have the option to take word wrapping into account. It really is about rows, not lines.

We can think about having an nlines method for tables (to be perfectly honest, I thought we already had one), but that will never be the same thing as nrow

Note for context that nrow for data.frames does not ever include the column names, only actual rows.

@gmbecker
Copy link
Collaborator

gmbecker commented Mar 8, 2023

Also, this is an issue for rtables, as that is where such a method would live, not here in formatters (which does not understand, and cannot have any code that directly interacts with, the VTableTree method).

I'd like to know a little more about the exact question you were trying to answer that lead you down this path, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Needs to consider if worth it or how enhancement New feature or request question Further information is requested sme Tracks changes for the sme board
Projects
None yet
Development

No branches or pull requests

2 participants