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

change update_cell() logic. fixes #356 #358

Merged
merged 9 commits into from
Oct 5, 2022
Merged

change update_cell() logic. fixes #356 #358

merged 9 commits into from
Oct 5, 2022

Conversation

JanMarvin
Copy link
Owner

@JanMarvin JanMarvin commented Oct 3, 2022

Currently an idea.

A test is this:

library(openxlsx2)

mm <- matrix(1,10000, 100)

wb <- wb_workbook()$
  add_worksheet()$
  add_data(x = mm)

wb$add_data(x = mm)
  • check if this is a valid replacement
  • add tests
  • remove dead code
  • remove update_cell() examples
  • creation and applying styles should only happen if there's no data on the sheet or if replace style is explicitly called

@JanMarvin
Copy link
Owner Author

Alright, I already love it. It removes a bunch of slow code and simplifies our data writing process from two different approaches to a single one.

* only create styles if no cc or removeCellStyle
* move examples to test
* cleanup update_cell
@JanMarvin
Copy link
Owner Author

If nothing comes up, I'll merge this tomorrow. We can test and tweak this afterwards if we need to. The benefits of having it even though it might not yet be perfect outweigh potential issues.

@JanMarvin JanMarvin merged commit 739218a into main Oct 5, 2022
@JanMarvin JanMarvin deleted the gh_issue_356 branch October 5, 2022 06:24
@JanMarvin JanMarvin mentioned this pull request Oct 13, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wb_add_data needs deep clone Writing a large dataframe on a preformated worksheet is slow
1 participant