我已经使用 R 一段时间了,我意识到如果您可以附加 data.frame 中包含的描述数据,将会有很大帮助,因为您可以在 .Rdata 文件中收集所有有用的研究信息。
我想添加到我的数据帧信息,就像 ?iris 显示的信息(描述 iris 数据帧中的数据)
但是我找不到办法做到这一点。
@Spacedman 对于这类事情有一个很好的一般答案。
如果你想要一些更奇特的东西,你可以尝试一下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()
and units()
从 在Hmisc
包提供了记录 data.frames 中各个列的机制。contents()
,在同一个包中,然后总结您附加到 data.frame 的所有这些属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)