-
Notifications
You must be signed in to change notification settings - Fork 76
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
NAs get added to xlsx file from just opening and closing #72
Comments
my branch contains a possible fix for this issue. The |
I had exactly the same kind of issue. @JanMarvin Do you want me to do some testing on the modification in your branch? |
Hi, I never thought of creating a pull request, since it looks to me as if it's intentional behavior. If you want to rebase it on master and create a pull request please go ahead. I'm currently busy with other things. Thanks for finding the original issue, I'll have a look! |
I recently encountered thee same issue. I noticed that all cell that is a results of a formula that returns an empty string "" is turned into NA, by simply loadWorkbook() and directly saveWorkbook(). I tried JanMarvin's suggested fixing. It works for me. However, JanMarvin@c47948f#comments Instead of the changes as suggested by JanMarvin, line 248 #vals[vals == ""] <- "NA" I hope someone who has enough knowledge about this package can put this fix into the current development version for test. |
Fixes #72 by adding an optional argument na.convert
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
i don't think i have the permissions to remove the
|
Just for reference, this is one of the issues solved in library(openxlsx2)
wb <- wb_load("https://github.com/ycphs/openxlsx/files/4603444/test.xlsx")
if(interactive()) wb$open() |
thanks @JanMarvin !! i'm reading the use of |
I'm not implying anything and luckily the future is unwritten. |
Just to comment so people know this issue is not really stale. I am encountering the same problem where empty cells are being converted to NA simply by loading and saving the workbook. I need to have them remain empty. I can force them to be empty if I read the data into a data frame, then rewrite it to the workbook with writeData(), but I am trying to avoid that since some of my files only need 1 of several tabs updated by the script. |
thank you!! |
Describe the bug
hi, thanks for the great software. any idea why these NAs get added to the attached test2 using 4_1_5_1.xlsx file? if the behavior is expected, a workaround would be great.. thank you!!
To Reproduce
Expected behavior
loading & immediately saving an xlsx file results in zero changes to xlsx file
test.xlsx
is the inputold version of
openxlsx
gives the expected result (4_0_17
)new version of
openxlsx
changes the file (4_1_5_1
)test.xlsx
test using 4_1_5_1.xlsx
test using 4_0_17.xlsx
session info
The text was updated successfully, but these errors were encountered: