Skip to content

Commit f7ffc52

Browse files
committed
Update R style guide and name convention.md
1 parent 889f12b commit f7ffc52

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

R style guide and name convention.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,24 @@
1515
File names should end in .R, delimeter '\_', lowercase notation and, of course, be meaningful.
1616

1717
**GOOD:** predict\_ad\_revenue.R
18-
**BAD:** foo.R
18+
19+
**BAD:** foo.R
1920

2021
### Identifiers
2122

2223
Don't use underscores ( _ ) or hyphens ( - ) in identifiers. Identifiers should be named according to the following conventions. Variable names have initial lower case letters. If variable name consists of several words, then they aren't separated, but all words except for the first one begin with capital letters. Function names are formed like variable names but with initial capital letter (FunctionName); constants are named like functions but with an initial k.
2324
- variableName
24-
** GOOD:** avgClicks
25-
**BAD:** avg_Clicks
25+
26+
**GOOD:** avgClicks
27+
28+
**BAD:** avg_Clicks
29+
2630
- FunctionName
27-
** GOOD:** CalculateAvgClicks
28-
** BAD:** calculate_avg_clicks , calculateAvgClicks
31+
32+
**GOOD:** CalculateAvgClicks
33+
34+
**BAD:** calculate_avg_clicks , calculateAvgClicks
35+
2936
Make function names verbs.
3037
*Exception: When creating a classed object, the function name (constructor) and class should match (e.g., lm).*
3138
- kConstantName

0 commit comments

Comments
 (0)