Once one starts writing more R code the need for consistency increases, as it facilitates managing larger projects and their maintenance. There are several style guides or suggestions for R; for example, Andrew Gelman’s, Hadley Wickham’s, Bioconductor’s and this one. I tend to write closer to Google’s R style guide, which contains some helpful suggestions. I use something similar but:

Of course you’ll find that the examples presented in this site depart from the style guide. I didn’t say that I was consistent, did I?

P.D. 2022-10-05 This is a very old post, which does not reflect my current practice. These days I use <- to assign, two spaces indentation, underscored_names, etc.