Is there a currently existing method in an R package for creating a codebook from a dataframe? Preferably, I would like to be able to export to a text file all relevant information. Thanks, Harold [[alternative HTML version deleted]]
On Thu, 30 Sep 2004, Doran, Harold wrote:> Is there a currently existing method in an R package for creating a > codebook from a dataframe? Preferably, I would like to be able to export > to a text file all relevant information. >There's something along these lines (though not quite what you want) in the latest version of the "foreign" package. The function write.foreign writes out two text files, one of data and one of code to read those data into some other package. It currently handles SPSS and Stata, and writeForeignSPSS writes out variable names and factor levels into the SPSS code file. It doesn't handle more complicated things such as dates, though. -thomas
Dear Harold, I'm not sure what you have in mind, but take a look at the prompt() function, which can create a skeleton .Rd (R documentation) for a data frame. It will distinguish between numeric variables and factors, and will show the various levels of each factor. I don't think that there's any other "relevant information" in the data frame. I hope that this helps, John> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Doran, Harold > Sent: Thursday, September 30, 2004 11:39 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Creating a text codebook > > Is there a currently existing method in an R package for > creating a codebook from a dataframe? Preferably, I would > like to be able to export to a text file all relevant information. >