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