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