From Wikipedia, the free encyclopedia
Size of this preview: 771 × 600 pixelsFull resolution (900 × 700 pixels, file size: 121 KB, MIME type: image/png)
[edit] Summary
This graph was created using R's ggplot2 package. Here is the source code, available under GPL version 2 and later as well as the licenses below.
library(reshape)
library(ggplot2)
polls <- read.csv("NZ opinion polls 2006-2008.csv")
polls$Date <- as.Date(polls$Date)
lpolls <- melt(polls[,-3], id.var=c("Poll", "Date"), variable_name="Party")
names(lpolls)[4] <- "Support"
levels(lpolls$Party)[3:4] <- c("NZ First", "Maori Party")
levels(lpolls$Party)[7] <- "United Future"
lpolls$Party <- with(lpolls, reorder(Party, Support))
p <- ggplot(lpolls[(lpolls$Date >= as.Date("2005-09-17")) &
(lpolls$Party %in% c("Labour", "National", "NZ First", "Greens")),],
aes(x=Date, y=Support, colour=factor(Party)))
p + geom_point() + stat_smooth() +
scale_colour_manual(name = "Party", values = c("black", "forestgreen", "red", "blue")) +
scale_x_date(major="6 months", format="%b-%Y") +
scale_y_continuous(breaks=seq(from=0, to=55, by=5), name="Party support (%)")
|
I, the copyright holder of this work, hereby publish it under the following licenses:
You may select the license of your choice.
|
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Dimensions | User | Comment |
| current | 01:33, 25 April 2008 | 900×700 (121 KB) | Avenue | |
File links
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):