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