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