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