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

generate_workbook produces error #110

Closed
jonathonmellor opened this issue Dec 5, 2023 · 4 comments · Fixed by #127
Closed

generate_workbook produces error #110

jonathonmellor opened this issue Dec 5, 2023 · 4 comments · Fixed by #127
Labels
bug Something isn't working must MoSCoW priority

Comments

@jonathonmellor
Copy link

a11ytables::generate_workbook(example_a11ytable)
Produces
Error in nchar(x) : 'nchar()' requires a character vector

Using version 0.2.0

@matt-dray matt-dray added bug Something isn't working must MoSCoW priority labels Dec 5, 2023
@matt-dray
Copy link
Collaborator

Cracking, thank you. As discussed, this seems to have been introduced in v0.2.0 and I think it's probably related to the checking/insertion of terminal periods (for accessibility purposes), which was adapted when introducing functionality for hyperlinks. You mentioned your error occurs whether supplying a dataframe or a list of cover information, so the issue is unlikely to be tied to that new functionality in particular.

@jonathonmellor
Copy link
Author

I hit this issue again today, or at least an nchar problem. Changing my tables to not have factors resolved the issue. Is it perhaps worth documenting somewhere that the user should coerce columns into characters before passing to a11ytables?

I wanted to change some ordering on my end for some dataframes, so went to factor, which broken things and was a bit of a challenge to debug.

@matt-dray
Copy link
Collaborator

Oops, I added #113 and somehow it's five months later. I'd like to address this soon in the code, but for sure it will get some documentation if that fails. Thank you again for prompting!

@matt-dray
Copy link
Collaborator

matt-dray commented May 27, 2024

Hi @jonathonmellor, this should now be fixed in #127 (the max character length of a column is used to decide if the column should be widened in the output spreadsheet, but nchar() doesn't actually accept factors). Hopefully that fixes the issue; let me know if you still have problems after installing the newly-released v0.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working must MoSCoW priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants