library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) 24000_Kiel <- sunrise.set(54.32933804825251,10.118408203125, "2024/01/01", timezone="MET", num.days=370) sunrise <- 24000_Kiel$sunrise sunset <- 24000_Kiel$sunset sunrise <- strftime(sunrise, format="%R", tz="MET") sunset <- strftime(sunset, format="%R", tz="MET") 24000_Kiel["sr"] <- as.POSIXct(sunrise, format = "%H:%M") 24000_Kiel["ss"] <- as.POSIXct(sunset, format = "%H:%M") 24000_Kiel["timestamp"] <- align.time(24000_Kiel$sunrise, 60*10) 24000_Kiel <- 24000_Kiel[c("timestamp", "sr", "ss")] locsrss <- ggplot(24000_Kiel, aes(x=24000_Kiel$timestamp)) + geom_line(aes(y=24000_Kiel$sr)) + geom_line(aes(y=24000_Kiel$ss)) + labs(title = " Sonnenauf-/Sonnenuntergang - 24000_Kiel 2024", x = "Datum", y = "Zeit") pdf("24000_Kiel_SA_SU.pdf", paper="a4r", width=11) locsrss dev.off() png(filename="24000_Kiel_SA_SU.png", width = 1400, height = 800, units = "px") locsrss dev.off() 24000_Kiel["Sonnenaufgang"] <- strftime(24000_Kiel$sr, format="%H:%M") 24000_Kiel["Sonnenuntergang"] <- strftime(24000_Kiel$ss, format="%H:%M") write.table(24000_Kiel, file="24000_Kiel_SaSu.csv", dec=',', sep=';', row.names=FALSE)