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