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