@Spacedman có câu trả lời chung tốt cho các loại điều này.
Nếu bạn muốn một thứ gì đó huyền ảo hơn, bạn có thể dùng thử comment()
.
comment(iris) <-
" This famous (Fisher's or Anderson's) iris data set gives the
measurements in centimeters of the variables sepal length and
width and petal length and width, respectively, for 50 flowers
from each of 3 species of iris. The species are _Iris setosa_,
_versicolor_, and _virginica_.\n"
cat(comment(iris))
# This famous (Fisher's or Anderson's) iris data set gives the
# measurements in centimeters of the variables sepal length and
# width and petal length and width, respectively, for 50 flowers
# from each of 3 species of iris. The species are _Iris setosa_,
# _versicolor_, and _virginica_.
label()
và units()
từ trong gói Hmisc
cung cấp cơ chế cung cấp tư liệu cột cá nhân trong data.frames. contents()
, trong cùng một gói, sau đó tóm tắt bất kỳ thuộc tính nào mà bạn đã đính kèm vào data.frame.
Nguồn
2011-10-27 17:13:02
Xem câu trả lời được cung cấp tại đây, sẽ hoạt động tốt như nhau đối với data.frames quá Tôi tin: http://stackoverflow.com/questions/6324568/function-commenting-conventions-in-r/ 6324618 # 6324618 – Chase