- 5
- 0
- 约5.67万字
- 约 14页
- 2017-06-08 发布于河南
- 举报
R措辞编码规矩(国外英文资料)
R语言编码规则(国外英文资料)
R language is a mainly used for statistical computing and graphics programming language. The R language encoding style guide is designed to make our R code easier to read, share and check. The following rules and Google R user group collaborative design.?
Summary: R coding style conventions
1. file naming: end with.R?
2. identifier naming: , FunctionName, kConstantName?
3. single line length: no more than 80 characters
4. indentation: two spaces, without tabs
5. blank
6. curly braces: the front brackets are not broken, the lines are written, and the back brackets are exclusive
7. assignment symbol: use left, rather than =??
8. semicolon: do not use
9. overall layout and order
Note: all 10. criteria to comment? #?, followed by a space; inline comments in #?? with two spaces
11. function definition and call
12. function document
13. sample function
14. TODO writing style: TODO (your user name)
Summary: R language usage rules
1. attach: avoid use
2. function: error (error) should be used. Stop (). Throw
3. objects and methods: avoid using S4 objects and methods as much as possible; never mix S3 and S4
Representation and naming
File naming
The filename should end with .R (uppercase). The name of the file itself is meaningful
Example:?
Predict_ad_revenue.R
Counter example?
Foo.R
Identifier naming
Do not use the underscore in identifiers (_??) or a hyphen (-?). Identifiers should be named according to the Convention. The following variables should be the point of use (.) separating all lowercase letters or words; the function name, initials, no separate (including word capitalized); with the constant naming rules function, but need to use a k? At the beginning.
V?
Example: avg.clicks?
Counterexample: avg_Clicks, avgClicks?
FunctionName?
Example: CalculateAvgClicks?
Counterexample: calculate_avg_clicks, calculateAvgClicks?
The function name should be a verb or a verb phrase
Exception: when you create an object with class (class) attributes, the function na
您可能关注的文档
- (高中英语词汇教授教化)(国外英文资料).doc
- (必修)《心思学》课程功课评讲(2(国外英文资料).doc
- 003短时记忆(国外英文资料).doc
- 01言语行动实际评述(国外英文资料).doc
- 040BG-II型塑料瓶包装联动线标准操纵规程(国外英文资料).doc
- 0610GRE填空真题解析(国外英文资料).doc
- 1 正确使用标点符号(国外英文资料).doc
- 100个问家长的题目(国外英文资料).doc
- 10. 连词(国外英文资料).doc
- 100以内带括号的练习题(国外英文资料).doc
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
原创力文档

文档评论(0)