Search code examples
rimageattributesworkspacerdata

R: How to add documentation in R workspace image


I have saved my workspace as R data with required variables to be shared with my colleagues. I was wondering if there is a way to add documentation or additional information such as basic variable descriptions, data author etc. with Rdata. I can add additional information to dataframes by adding attributes by using attr(). I was wondering if there is a more elegant way of doing this for the entire R workspace.


Solution

  • You could save text that describes everything as an object in the .RData file

    README <- scan("text_that_describes_everything.txt",sep="\n",what="character")