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