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