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