-
Notifications
You must be signed in to change notification settings - Fork 73
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
Reconsider the addition of overwrite = FALSE argument to write.xlsx #249
Comments
Hi @jeromyanglim , I'm in favor of changing the default, though it leaves the potential problem, that the onus will be on the others who rely on the current behavior. What do you think @ycphs ? |
I'd be favor of the default of However, I'm fairly certain this change was introduced unintentionally. There are no notes about it in the NEWS and the documentation for |
The default of |
I've recently upgraded openxlsx (i.e., version 4.2.4).
The function write.xlsx now appears to have a default argument
overwrite = FALSE
.This appears to be new. I don't upgrade all that often, so my apologies if it's been around for quite a while.
I think this default is undesirable for several reasons:
write.csv
,write.table
. In fact, just about any function that allows you to save a file in R allows you save that file over the top of an existing file.overwrite = TRUE
to the function call. This is surprising behaviour and adds to the verbosity and mental load of using the function.A typical example of me using write.xlsx would be where I have generated some results, and I'm saving these to a folder.
If I re-run the analyses, I'll save the latest results over the top.
In general, I think you can think of R users as mature enough to know that files generated by R (e.g., using tools like write.xlsx) should not be edited in place.
So, I think the best solution would be to make the default
overwrite = TRUE
again especially forwrite.xlsx
.The text was updated successfully, but these errors were encountered: