@Spacedman ma dobrą ogólną odpowiedź na tego typu rzeczy.
Jeśli chcesz coś bardziej wyszukanego, możesz wypróbować 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()
i units()
z w pakiecie Hmisc
zapewnienie mechanizmów dokumentujących poszczególne kolumny w data.frames. contents()
, w tym samym pakiecie, a następnie podsumowuje wszystkie te atrybuty dołączone do data.frame.
Zobacz odpowiedzi pod warunkiem tutaj, powinny działać równie dobrze dla data.frames też Uważam: http://stackoverflow.com/questions/6324568/function-commenting-conventions-in-r/ 6324618 # 6324618 – Chase