Data
Data are acquired from KNMI. They have various sets of data, this page has a selection form which leads to the data used today. The data comes with a header explaining details, unfortunately in Dutch.Plots
Just about everybody knows days are shorter in winter. What I never realized, even within that shorter day, we get less daylight. The short days are often so clouded, we don't get sun, meanwhile, in summer the sun does shine a bigger part of the daylight period.What we do get, not surprising since Dutch weather is fairly similar to English weather, is rain. Not continuous rain, most of the time it is dry, but still, autumn and winter do have days where it does not seem to stop. Autumn has the bad reputation for rain, but this plot makes winter look particular bad.
Code
library(plyr)
library(dplyr)
library(ggplot2)
r1 <- read.csv('KNMI_20141115.edited.txt')
Sys.setlocale(category = "LC_TIME", locale = "C")
r2 <- mutate(r1,
date = as.Date(format(YYYYMMDD),'%Y%m%d'),
month =factor(months(date,abbreviate=TRUE),
levels=months(as.Date(
paste('2014',
formatC(1:12,digits=2,width=2,flag='0'),
'01',sep='-')),
abbreviate=TRUE)),
yearf=factor(format(date,'%Y')),
yearn=as.numeric(substr(YYYYMMDD,1,4)),
day=format(date,'%e'))
g1 <- ggplot(r2,aes(x=month,y=SP))
g1 + geom_violin() +
ylab('% of longest possible sunshine')
g1 <- ggplot(r2,aes(x=month,y=SQ/10))
g1 + geom_violin() +
ylab('Sunshine duration (h)')
g1 <- ggplot(r2,aes(x=month,y=DR/10))
g1 + geom_violin() +
scale_y_continuous('Precipitation Duration (h)',
breaks=c(0,6,12,18,24))
g1 <- ggplot(r2,aes(x=month,y=UG))
g1 + geom_violin() +
ylab('Relative Humidity (%)')
g1 <- ggplot(r2,aes(x=month,y=TG/10))
g1 + geom_violin() +
ylab('Temperature (C)')
No comments:
Post a Comment