ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
226 stars 75 forks source link

WriteData() and WriteDataTable() is not working in Linux environment for reactive values #339

Closed evelinedurom closed 2 years ago

evelinedurom commented 2 years ago

When trying to download an excel from a shiny app the WriteData and WriteDataTable was throwing errors in the linux environment for reactive values. The code was working fine in the windows but when shifted to linux it started to give the following error message.

Warning: Error in <-: replacement has length zero
  [No stack trace available]

When tried with a non-reactive value the excel was downloaded successfully. Also the write.xlsx function works fine in both the linux and windows environment.

JanMarvin commented 2 years ago

Hi @evelinedurom , unless you can provide a minimal working example I don't think we can help you with your issue. Our code is tested on Windows, Mac and Linux. Maybe you have different R or package versions running or you have some unrelated bug in your shiny code.

evelinedurom commented 2 years ago

Hi @JanMarvin , After spending some time , I think I was able to identify the issue. In the reactive dataframe, I was using to create the excel, one of the columns was present as a column containing vector elements. On converting the vectors to string I was able to successfully download the excel in the Linux environment. In the Windows environment this particular column did not cause any issues.

JanMarvin commented 2 years ago

Glad that you have got it figured out. I close this here