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