我已经使用R一段时间了,我已经意识到如果你可以附加data.frame中包含的描述数据会有很大的帮助,因为你可以在.Rdata文件中收集所有有用的研究信息.
我想添加我的数据帧信息,例如?iris显示的信息(描述虹膜数据帧中的数据)
但是我找不到办法做到这一点.
Jos*_*ien 26
@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()并且units()从在Hmisc包中记录data.frames各个列提供的机制.  contents(),在同一个包中,然后汇总您附加到data.frame的任何这些属性.
Spa*_*man 21
您可以将其添加为任意属性:
attr(df,"doc") = "This is my documentation"
这些东西大多是通过切片n子集来保留的,但是有些进程会删除它们.这就是价值转换系统的本质.
CRAN上甚至可能有一个包用于更复杂的元数据作为包含某些包装函数的属性,但在其所有属性下面...