yihui / formatR

Format R Code Automatically
https://yihui.org/formatr/
255 stars 52 forks source link

Suggestion: change the default reindent.spaces to 2. #39

Closed kendonB closed 10 years ago

kendonB commented 10 years ago

Quick suggestion:

Consider changing the reindent.spaces default to 2 as per the Hadley and Google R style guides.

Hope this helps.

yihui commented 10 years ago

It is easy for you to do it by yourself -- just put this in your ~/.Rprofile

options(reindent.spaces = 2)
kendonB commented 10 years ago

Thanks to Yihui for this! Readers should note that reindent.spaces is showing as deprecated. options(formatR.indent = 2) should work without warnings.

yihui commented 10 years ago

@kendonB Oh yes, that is a change I made a few days ago, because I think options(formatR.xxx) is a better naming scheme. Thanks a lot for the correction!