Displaying 1 result from an estimated 1 matches for "draw_metric_by_date".
2009 Apr 29
2
help converting for loop to vector operation
Dear List,
I have a wrapper function that draws a graph that I'd like to use in a vector-like manner. The for-loop version I currently use is below.
library(ggplot2)
data(economics)
h <- 600
w <- 800
#----------------------------------------------------------
draw_metric_by_date <- function( df, i, smooth=FALSE, BASEPATH ) {
mlabel <- names(df)[i]
qmetric <- qplot( data=df, x=date, y=df[,i], geom=c('line','jitter'), ylab=mlabel, main=mlabel, colour=I("dark blue") )
if ( smooth == TRUE ) {
print(&q...