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