Set manually `stringsAsFactors = FALSE`
Closed this issue · 0 comments
From Tom at SG via email:
I tried running through your example: https://co-analysis.github.io/a11ytables/articles/a11ytables.html
We are only using R 3.6.3... At R versions >= 4.x.x data.frame stringsAsFactors argument is FALSE by default (I think), but this is TRUE at R 3.6.3.
This means the data frame “x” in a11ytable.R - create_a11ytable function has columns created as factors, not character and this leads the utils-a11ytable.R .append_period function to fail when it calls nchar() – so the process fails.
[we] can fix it by setting options(stringsAsFactors=FALSE) without needing to edit the code in your package. However, I thought you might help others stuck on lower versions of R by hardcoding stringsAsFactors=FALSE in your data.frame call.
Set stringsAsFactors = FALSE
and test on R <4.1