R/createRawGraphs.R

Defines functions createRawGraphs

########################################################################################################################
createRawGraphs <- function(long.table, out.path) {
    dir.create(out.path, showWarnings = FALSE, recursive = TRUE)
    for (year in long.table[, unique(year(Datum))]) {
        for (var.name in long.table[, unique(variable)]) {
            p <- ggplot(long.table[year(Datum) == year & variable == var.name], aes(x = Datum, y = value)) +
                geom_point() +
                scale_y_continuous(limits = long.table[, c(min(value), max(value))])
            ggsave(paste0(out.path, "/", var.name, "_", year, ".png"), plot = p)
        }
    }
}
Sumpfohreule/BodenfeuchteGraphen documentation built on May 12, 2022, 10:26 a.m.