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
Codebook is slow #17
Comments
Working on issue #17. Codebook is slow.
How long does it take to run regular data?
How long does it to run on Stata data?
So, that doesn't seem to make a huge difference. What are the slow parts?
The Flextable stuff is the slowest part. I'm not sure if I can speed that up or not.
Flextable stuff for this one too. Can I do the Flextable stuff at once outside of a loop? Will that make any difference? Do more rows slow it down?
So, adding more observations slows it down. Do more columns slow it down?
So, adding more columns slows it down A LOT! What parts of the code take the longest to run?
The flextable parts take the longest (i.e., body_add_flextable and regular_table).
The flextable parts take the longest (i.e., body_add_flextable, body_add_par, and regular_table).
unique.default and cb_add_summary stats take the longest. There isn't a way for me to change the internals of the flextable functions, but I do wonder if me applying them in a different way would speed things up? |
Issue #17 - The solution for this problem came from: https://ardata-fr.github.io/officeverse/officer-for-word.html#external-documents
Part of issue #17 - Now that all the solution has been added to the codebook function, these files shouldn't be needed anymore. However, they are part of the last commit if they are ever needed.
While running the codebook function on the L2C data, I realized how slow it is. In some ways, this may not be a huge issue because we probably want need to recreate codebooks often. Having said that, it might be nice to try to find ways to speed up the code.
https://www.r-bloggers.com/2021/04/code-performance-in-r-which-part-of-the-code-is-slow/
http://adv-r.had.co.nz/Performance.html
Using HTML instead of Word (#5) might be a good way to speed it up.
Solution
The solution for this problem came from: https://ardata-fr.github.io/officeverse/officer-for-word.html#external-documents
The text was updated successfully, but these errors were encountered: