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