2014 Rainy Season Stats Just wanted to look at the duration of this year’s rainy season and how it stacked up against past years. Seemed long to me. But… it really wasn’t. I made a couple cute graphics using ggplot2 (of course). I got the data from the NWS Miami. Share this:TwitterFacebookLike this:Like Loading... Related 4 thoughts on “2014 Rainy Season Stats” Add yours Interesting way to show this data! Let me know if there’s any other data I can provide you with. Reply Thanks! I LOVE getting new data… Let me know if you have anything fun for me to analyze 🙂 Reply That’s great Lisa! I’m glad others are seeing the power and flexibility of R rather than defaulting to Excel. Here is another snippet you might be able to use depending on what you are plotting! 🙂 ## Create 8760 random Weibull distribution wind speeds and plot library(ggplot2) library(reshape2) library(plyr) shape <- 3.3 scale <- 7.5 data <- data.frame("ID"="tower1", "wind.speed"=rweibull(n=8760, shape=shape, scale=scale)) data.melt <- melt(data, id=c("wind.speed", "ID"), measure.var=c("wind.speed")) data.cdf <- ddply(data.melt, "ID", summarise, rating.mean=mean(wind.speed)) p <- ggplot(data.melt, aes(x=wind.speed, fill=ID)) + geom_histogram(aes(y=..density..), colour="black", fill="yellow", binwidth=.5, alpha=.4, position="identity") + stat_density(colour="blue", geom="line", alpha=0.8, position="identity") + geom_vline(data=data.cdf, aes(xintercept=rating.mean, colour=ID), linetype="dashed", size=0.75) + xlab("wind speed (m/s)") + ylab("density") + ggtitle("Wind Speed Plot\n Wiebull distribution (scale=7.5, shape=3.3)") ggsave(filename="weibullwindspeeds.pdf", plot=p, scale=1, width=8.5, height=11, units="in", dpi=300) Reply the data assignment got all messed up with the copy… data <- data.frame("ID"="tower1", "wind.speed"=rweibull(n=8760, shape=stdev, scale=avg)) Reply Leave a Reply Cancel reply Enter your comment here... Fill in your details below or click an icon to log in: Email (required) (Address never made public) Name (required) Website You are commenting using your WordPress.com account. ( Log Out / Change ) You are commenting using your Twitter account. ( Log Out / Change ) You are commenting using your Facebook account. ( Log Out / Change ) You are commenting using your Google+ account. ( Log Out / Change ) Cancel Connecting to %s Notify me of new comments via email.