Previous: Usage Overview Up: JUDGEIT II: A Program Next: Included Data Sets

Formatting Data Sets

JUDGEIT requires each election to be reported in an object of type data.frame. This is natural if your data is in a comma-separated or tab-delimited file, since operations like

data <- read.csv("ohio.csv")
data2 <- read.table("cali98.txt")

will automatically put these tables into the data frame format. It is important to make sure that each variable is labeled before using it in the function judgeit , either by making the first line of the data file contain variable names, or by assigning them afterwards. For example:

data <- read.csv("ohio.csv",header=FALSE)
colnames(data) <- c("district","vote","inc")

Since most JUDGEIT analyses will involve a series of consecutive elections, judgeit accepts such a series as an object of type list. Suppose we have three elections, say Ohio's State Legislature in 1992, 1994 and 1996, and that each election is stored in a data frame as above. To integrate the separate data frames, use the command elections <- list(oh1992,oh1994,oh1996) which will create an object named ``elections". Each year's election data must use the same variable names, so that JUDGEIT can recognize the same quantity across different elections.



Gary King 2010-08-31