rcsvdefaultswrite.table

Do you always use row.names=F in write.csv? Changing the default values inside R (base) functions


Couldn't see a solution online but I thought this might be quite common.

EDIT: So, I'm looking for a solution that will work for multiple functions if possible: paste, write.csv, table and other functions like these.


Solution

  • Try this:

    paste <- paste
    formals(paste)$sep <- ""
    

    This creates a new copy of paste in your workspace, and then modifies its default value for sep to "". Subsequent calls to paste will then use the modified copy, as it sits in front of the base environment in your search path.