You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of complementary functionality I want to use "xlsx" after package "xlconnect".
However, the code snippet, which works when issued alone, fails when executed after having used "xlconnect" in the same session.
#A: usage of XLConnect ####
library(XLConnect)
wb <- XLConnect::loadWorkbook(file = paste0(tempfile(),".xlsx"), create = TRUE) #create an empty xlsx
# unload package and its dependencies
try(detach("package:XLConnect", unload=TRUE, force = TRUE), silent = TRUE)
try(detach("package:XLConnectJars", unload=TRUE, force = TRUE), silent = TRUE)
try(detach("package:rJava", unload=TRUE, force = TRUE), silent = TRUE)
#B: usage of xlsx ####
library(xlsx)
wb <- createWorkbook()
cs <- CellStyle(wb) + #create a cell style
Font(wb, heightInPoints=20) +
Fill(backgroundColor="lavender")
-> error
Error message:
Error in .jcall(cellStyle, "V", "setFillPattern", .jshort(CS[fill$pattern])) : method setFillPattern with signature (S)V not found
As the related issue suggests, this is not something that is supported. Both packages are trying to use the same underlying Java library and therefore have some conflicts.
Because of complementary functionality I want to use "xlsx" after package "xlconnect".
However, the code snippet, which works when issued alone, fails when executed after having used "xlconnect" in the same session.
Error message:
There is a complementary error when using the packages in the reverse order (miraisolutions/xlconnect#79).
Is there a workaround for this except restarting R?
The text was updated successfully, but these errors were encountered: