R Coding Style
Posted on Jun 23, 2016 in Programming
Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.
** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **
- You can use the function
tidy_souce
in the R packageformatR
to format R code.
tidy_source('unformatted.r', file = 'formatted.r')
However,
there is a bug in the package formatR
.
For example,
the formatR
fails to work with the following code.
if { # this is comment
...
}
- Avoid changing the type of object.