Skip to content
Snippets Groups Projects
Commit b3df632b authored by xo30xoqa's avatar xo30xoqa
Browse files

Expanded Jena weather data to 1990-2023

parent b7a84c85
No related branches found
No related tags found
No related merge requests found
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
library(tidyverse) library(tidyverse)
## replace this with the correct file name ## replace this with the correct file name
weatherfile = "daily_weather_jena_dwd/produkt_klima_tag_18210101_20221231_02444.txt" weatherfile = "produkt_klima_tag_18210101_20231231_02444.txt"
data = read.table(weatherfile, sep=";", header=T) data = read.table(weatherfile, sep=";", header=T)
weather = data %>% weather = data %>%
## drop values before 2000 to save space ## drop values before 1990 to save space
filter(MESS_DATUM>=20000101) %>% filter(MESS_DATUM>=19900101) %>%
## select relevant variables and convert place-holder values to NA ## select relevant variables and convert place-holder values to NA
select(MESS_DATUM, FM, RSK, SDK, VPM, TMK, TXK, TNK) %>% select(MESS_DATUM, FM, RSK, SDK, VPM, TMK, TXK, TNK) %>%
mutate(date=MESS_DATUM, MESS_DATUM=NULL, mutate(date=MESS_DATUM, MESS_DATUM=NULL,
...@@ -28,4 +28,4 @@ weather = data %>% ...@@ -28,4 +28,4 @@ weather = data %>%
min_temperature=na_if(TNK, -999), TNK=NULL) min_temperature=na_if(TNK, -999), TNK=NULL)
## replace with the desired file name ## replace with the desired file name
write.csv(weather, file="weather_jena.csv", row.names=FALSE) write.csv(weather, file="weather.csv", row.names=FALSE)
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment