Skip to content

Workbook class does not work in 1.8 #1088

Answered by JanMarvin
lz1nwm asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lz1nwm ,

you have to assign wrapper functions.

library(openxlsx2)
df <- data.frame(ID = c(1, 2, 3, 4, 5),
                 var1 = c('a', 'b', 'c', 'd', 'e'),
                 var2 = c(1, 1, 0, 0, 1))
wb <- wb_workbook()

# Working
wb$add_worksheet(sheet = 'A')
wb$add_data(sheet = 'A', x = df, na.strings = NULL)
xl_open(wb, interactive = T)

# Also working
wb <- wb_workbook()
wb <- wb_add_worksheet(wb, sheet = 'A')
wb <- wb_add_data(wb, sheet = 'A', x = df, na.strings = NULL)
xl_open(wb, interactive = T)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@lz1nwm
Comment options

@JanMarvin
Comment options

@lz1nwm
Comment options

@JanMarvin
Comment options

Answer selected by lz1nwm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1087 on July 18, 2024 08:22.