Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load("allRes.rda")
- dat <- data.frame(
- rbind(
- cbind("Kadencja VII",substr(unlist(allRes7), 1, 2))
- ,
- cbind("Kadencja VIII",substr(unlist(allRes8), 1, 2))
- )
- )
- names(dat) <- c("kadencja","godzina")
- dat$godzina <- as.numeric(levels(dat$godzina))[dat$godzina]
- if(!require(ggplot2)){
- install.packages("ggplot2")
- }
- library(ggplot2)
- # Interleaved histograms
- ggplot(dat, aes(x=godzina, fill=kadencja)) +
- geom_histogram(binwidth=.5, position="dodge")
- # Density plots with semi-transparent fill
- ggplot(dat, aes(x=godzina, fill=kadencja)) + geom_density(alpha=.3)
- # With flipped axes
- ggplot(dat, aes(x=kadencja, y=godzina, fill=kadencja)) + geom_boxplot() +
- guides(fill=FALSE) + coord_flip() + stat_summary(fun.y=mean, geom="point", shape=5, size=4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement