SBOHVM / RPiR

The Reproducible Programming in R course, developed by the School of Biodiversity, One Health and Veterinary Medicine at the University of Glasgow.
https://sbohvm.github.io/RPiR/
GNU General Public License v3.0
12 stars 2 forks source link

Object naming convention #8

Closed soniamitchell closed 3 years ago

soniamitchell commented 3 years ago

I'd like to replace dots in object names with underscores

http://adv-r.had.co.nz/Style.html

richardreeve commented 3 years ago

I have gone back and forth about this over the years. I absolutely agree with avoiding dots in function names, because func.dataframe() has a meaning in base R. However, I've had a lot of problems over the years with trying to eliminate dots from variable names in general because they are so pervasive and it was confusing people. In fact, the style guide doesn't call these bad, they just don't come under good. As a result we actually reverted the course from insisting on underscores everywhere to just using underscores for function names a couple of years ago. I think linking to the style guide is a good idea though!

soniamitchell commented 3 years ago

I do prefer the look of dots myself.. but now use underscores, even though you have to press shift! I guess it's not really important for the purpose of this course anyway.

richardreeve commented 3 years ago

I think it's definitely worth mentioning, but we'll only insist on it for function names.