Yogesh Tiwari
2008-Sep-12 13:17 UTC
[R] how to plot monthly mean data showing missing months
Dear R users, As per my attached script I am ploting monthly mean data which has missing months. But in the plot missing months are not shown (plot attached). Kindly help how to show complete plot (Jan-Dec) with missing months. Regards, Yogesh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: script.txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080912/70cab1e2/attachment.txt>
Richard.Cotton at hsl.gov.uk
2008-Sep-12 15:17 UTC
[R] how to plot monthly mean data showing missing months
> As per my attached script I am ploting monthly mean data which hasmissing> months. > But in the plot missing months are not shown (plot attached). > Kindly help how to show complete plot (Jan-Dec) with missing months.I don't accept scripts from strangers, but I guess the problem looks like this: df <- data.frame(a=runif(5), b=c("Jan", "Feb", "Sep", "Jan", "Mar")) histogram(~a|b, df) #only four months plotted df$b <- factor(df$b, levels=month.abb) #force factor to have all months as levels histogram(~a|b, df, drop.unused.levels=FALSE) #12 months plotted Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}