R 防御式编程
Colin Gillespie
Jumping Rivers
# 为 R 代码添加注释# This is a comment
# The above comment isn't very helpful
# Or is it?
# Loop through data sets
for (dataset in datasets) {
# Read in data set
r <- read.csv(dataset)
}
看起来合理最常见的是文件顶部的头部注释
# Last updated: 1967-02-25
# Author: D Law
# Status: No 1
# list of packages used: XXX, YYY# 或双个 ## 开头R 防御式编程