library(tidyverse, warn.conflicts = FALSE)
library(tidyr, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)

CSV_FILE <- 'produkt_klima_tag_19350101_20211231_01303.txt'
messwerte <- read.delim(CSV_FILE, sep=';')

messwerte <- messwerte %>% 
  select(MESS_DATUM, TMK) %>%
  filter(MESS_DATUM > 20021209 & MESS_DATUM < 20031209)

write.csv(messwerte, file='2002.csv',quote=FALSE)


g <- ggplot(data = messwerte, aes(x = TMK)) +
  geom_histogram(binwidth = 1)
print(g)

