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