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