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