简体   繁体   中英

R write.table conventions

Why is the R write.table() function set to quote column names and label row.names by default?

Also, is it possible to change these defaults so that they do not need to be manually changed in every call of write.table used in a script?

Just like in studying nature, we generally don't know WHY. It is because R gods said so. This reminds me of stringsAsFactors being TRUE by default, which doesn't suit a certain type of users. The beautiful thing about all this is that you can always change it to meet your needs.

What you can do is overwrite the function with custom default values in your .Rprofile (see this question ) or even better, make your own personal R package (perhaps using GitHub? ) that implements the same function using different defaults.

您还可以复制的r write.table()到自定义的功能,如write.table2()函数,则改变逻辑论证的默认值quotewrite.table2()为false。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM