Posts

Showing posts from August, 2012

Create a pdf data dictionary from a dataset

Here is some R code you can use to create a pdf data dictionary from a dataset. It's a quick and easy way to get an overview of a dataset. You need to have a latext program like MiKTeX installed to make it work.   You can see the sort of output it produces here . ####################################### # code to produce a pdf data dictionary of a dataset using sweave # # df: the data frame you want to create the data dictionary of # file_loc: the location where you want the resulting report stored # filename: the name you want the report to have # author: the name of the person who created the data dictionary # #######################################     data_dict <- function ( df , file_loc , file_name , author , num_lev = 2 ) { # initiate libraries library ( tools ) library ( ggplot2 ) library ( gplots ) library ( lattice ) library ( sqldf )   #Make some subsidary functions   # initial funtion to print without quotes and line numbe