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.

length of rainy season bars length of rainy season

4 thoughts on “2014 Rainy Season Stats

Add yours

  1. 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

    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)

    1. the data assignment got all messed up with the copy…

      data <- data.frame("ID"="tower1", "wind.speed"=rweibull(n=8760, shape=stdev, scale=avg))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: