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

speedup numfmt assignment #423

Merged
merged 7 commits into from
Nov 21, 2022
Merged

speedup numfmt assignment #423

merged 7 commits into from
Nov 21, 2022

Conversation

JanMarvin
Copy link
Owner

provides new function dataframe_to_dims().

library(openxlsx2)

beg <- "1900-1-1"
end <- "2022-11-18"

dat <- seq(
  from = as.POSIXct(beg, tz="UTC"),
  to   = as.POSIXct(end, tz="UTC"),
  by   = "day"
)

out <- data.frame(
  date = dat,
  chr  = as.character(dat),
  num  = seq_along(dat)-1
)

# huge improvement
wb <- wb_workbook() %>% 
  wb_add_worksheet() %>%
  wb_add_data(x = out) %>% 
  wb_add_numfmt(dims = "C1:C44882", numfmt = "#.0") %>% 
  wb_open()

@JanMarvin JanMarvin added the enhancement 😀 New feature or request label Nov 19, 2022
@JanMarvin JanMarvin linked an issue Nov 19, 2022 that may be closed by this pull request
@JanMarvin JanMarvin added this to the v0.4 milestone Nov 20, 2022
@JanMarvin JanMarvin mentioned this pull request Nov 20, 2022
8 tasks
@JanMarvin JanMarvin merged commit c797b06 into main Nov 21, 2022
@JanMarvin JanMarvin deleted the gh_issue_420 branch November 21, 2022 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 😀 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing large formated data frames is slow
1 participant