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