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