Every now and then I realize that my attempts to document what all dataframes consist of are unsufficient. So far, I have been writing notes in an external file. Are there any better ways to do this within R? One possibility could be to set up the data as packages, but I would like to have a solution on a lower level, closer to data. I can't find any pointers in the standard manuals. Suggestions are most welcome. Robert ********************** Robert Lundqvist Norrbotten regional council Sweden [[alternative HTML version deleted]]
There is a 'comment' function. It sets an attribute which gets carried along with the dataframe when it is saved or copied: > df1 <-data.frame(NA) > df1 NA. 1 NA > comment(df1) <- "empty dataframe" > comment(df1) [1] "empty dataframe" > df2 <- df1 > comment(df2) <- c(comment(df1), "copy of df1") > comment(df2) [1] "empty dataframe" "copy of df1" > comment(df1) <- c("empty dataframe", summary(df1)) > comment(df1) [1] "empty dataframe" "Mode:logical " "NA's:1 " On Jun 22, 2011, at 10:57 AM, Robert Lundqvist wrote:> Every now and then I realize that my attempts to document what all > dataframes consist of are unsufficient. So far, I have been writing > notes in an external file. Are there any better ways to do this > within R? One possibility could be to set up the data as packages, > but I would like to have a solution on a lower level, closer to > data. I can't find any pointers in the standard manuals. Suggestions > are most welcome. > > Robert > > ********************** > Robert Lundqvist > Norrbotten regional council > Sweden > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT
Have a look at the AnnotatedDataFrame class in the Biobase package [1]. Here is the description from the manual: An ?AnnotatedDataFrame? consists of two parts. There is a collection of samples and the values of variables measured on those samples. There is also a description of each variable measured. The components of an ?AnnotatedDataFrame? can be accessed with ?pData? and ?varMetadata?. Hope this helps, Laurent [1] http://bioconductor.org/packages/release/bioc/html/Biobase.html On 22 June 2011 15:57, Robert Lundqvist <Robert.Lundqvist at nll.se> wrote:> Every now and then I realize that my attempts to document what all dataframes consist of are unsufficient. So far, I have been writing notes in an external file. Are there any better ways to do this within R? One possibility could be to set up the data as packages, but I would like to have a solution on a lower level, closer to data. I can't find any pointers in the standard manuals. Suggestions are most welcome. > > Robert > > ********************** > Robert Lundqvist > Norrbotten regional council > Sweden > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
The memisc package also offers functionality for documenting data. Jan On 06/22/2011 04:57 PM, Robert Lundqvist wrote:> Every now and then I realize that my attempts to document what all dataframes consist of are unsufficient. So far, I have been writing notes in an external file. Are there any better ways to do this within R? One possibility could be to set up the data as packages, but I would like to have a solution on a lower level, closer to data. I can't find any pointers in the standard manuals. Suggestions are most welcome. > > Robert > > ********************** > Robert Lundqvist > Norrbotten regional council > Sweden > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.