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