@Spacedman ha la buona risposta per questo genere di cose.
Se desideri qualcosa di un po 'più elaborato, puoi provare lo 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()
e units()
dalla nel pacchetto Hmisc
prevedono meccanismi per documentare singole colonne in data.frames. contents()
, nello stesso pacchetto riepiloga uno di questi attributi che hai allegato a data.frame.
fonte
2011-10-27 17:13:02
Vedi le risposte fornite qui, dovrebbe funzionare altrettanto bene per data.frames anch'io credo: http://stackoverflow.com/questions/6324568/function-commenting-conventions-in-r/ 6324618 # 6324618 – Chase