Kalendarz na 2012

Jeszcze nie testowałem, ale jest to godne uwagi

    library(ggplot2)
 
    # setting a 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"))
 
    # creating a image with ggplot2.
    c <- ggplot(z, aes(D, M))
    c + geom_text(aes(label=z$D, colour=factor(W), size = 20)) +
    scale_colour_manual(values = c("magenta", rep("black", 5),"darkturquoise"))+
    scale_y_continuous(trans = "reverse", breaks = 1:12) +
    labs(x="", y="") +
    opts(
    title = paste("CalendaR", year, "\n", sep = " "),
    plot.title = theme_text(colour = "black"),
    legend.position = "none"
    ) 

Created by Pretty R at inside-R.org

Źródło: R-bloggers / Knowledge Discovery

admin czwartek, 15 grudzień 2011 - 1:15 pm | | Blog-R