@Spacedman tiene la buena respuesta general para este tipo de cosas.
Si desea algo un poco más elegante, puede probar 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()
y units()
de la en el paquete Hmisc
proporcionar mecanismos para la documentación de columnas individuales en data.frames. contents()
, en el mismo paquete, a continuación, resume cualquiera de estos atributos que ha adjuntado al data.frame.
Ver las respuestas proporcionadas aquí, también debería funcionar para data.frames Creo: http://stackoverflow.com/questions/6324568/function-commenting-conventions-in-r/ 6324618 # 6324618 – Chase