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