cRazydays 2012 with ggplot2
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Season’s Greetings
Hi, dear R-bloggers and its readers. Here in Japan it’s very cold now.
The end of one year is coming soon.
How was your year 2011 ?
As for me, I started to learn R on september this year, and found it very enjoyable.
So I posted a few blog on R-bloggers, e.g. “Japan Quake Map“.
By the way, I made a “cRazydays 2012″ with ggplot2,
as another version of “CalendaR 2012“.
With best wishes for next year.
Appendix
Sample script of “cRazydays 2012″ is as follows:
library(ggplot2)
# setting parameter
year <- 2012
d <- seq.Date(as.Date(paste(year, "-01-01", sep = "")), as.Date(paste(year, "-12-31", sep = "")), by="days")
z <- data.frame(Y = format(d, "%Y"), M = as.numeric(format(d, "%m")), D = as.numeric(format(d, "%d")), W = format(d, "%w"))
textangle <- sample(360, nrow(z), replace=TRUE)# creating image with ggplot.
c <- ggplot(z, aes(D, M))
c + geom_text(aes(label=z$D, colour=factor(W), size = 20, angle =textangle)) +
scale_colour_manual(values = c(“magenta”, rep(“black”, 5),”darkturquoise”))+
scale_y_continuous(trans = “reverse”, breaks = 1:12) +
labs(x=””, y=””) +
opts(
title = paste(“cRazydays”, year, “\n”, sep = ” “),
plot.title = theme_text(colour = “black”),
legend.position = “none”
)
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.