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