Get started

library(valorisationQE)

Graphique de la pluviométrie

Ces graphiques affichent la pluviométrie entre 2 dates sous forme d’histogrammes.


if (interactive()) {
  config_path <- "C://workspace//gwilenalim//yaml//config.yml"
  if (file.exists(config_path)) {
    library(RPostgres)
    library(meteo4Vilaine)
    config <- yaml::read_yaml(config_path)
    con <- tryCatch({
      DBI::dbConnect(
        RPostgres::Postgres(),
        host = config$host,
        port = config$port,
        user = config$user,
        password = config$password,
        dbname = config$dbname
      )
    }, error = function(e) NULL)
    
    
    
    if (!is.null(con)) {
      
      triangle_sf <- sf::st_sf(
        geometry = sf::st_sfc(
          sf::st_polygon(list(rbind(
            c(-1.6794, 48.1147),  # Rennes
            c(-1.2100, 48.1230),  # Vitré
            c(-1.5025, 47.6833),  # Derval
            c(-1.6794, 48.1147)   # Retour à Rennes
          )))
        ),
        crs = 4326
      )
      
      g<-f_graph_pluviometrie(triangle_sf, date = as.Date("2025-09-11"), con)
      DBI::dbDisconnect(con)
      print(g)
    } else {
      message("Connexion à la base impossible, exemple non exécuté.")
    }
  } else {
    message("Fichier de configuration introuvable.")
  }
}

knitr::include_graphics(system.file("extdata", "graph_pluvio.png", package = "valorisationQE"))

f_fond_de_carte


   triangle_sf <- sf::st_sf(
        geometry = sf::st_sfc(
          sf::st_polygon(list(rbind(
            c(-1.6794, 48.1147),  # Rennes
            c(-1.2100, 48.1230),  # Vitré
            c(-1.5025, 47.6833),  # Derval
            c(-1.6794, 48.1147)   # Retour à Rennes
          )))
        ),
        crs = 4326
      )

f_fond_de_carte(triangle_sf, zoom=9)
#> Coordinate system already present.
#> ℹ Adding new coordinate system, which will replace the existing one.

Inflate your package

You’re one inflate from paper to box. Build your package from this very Rmd using fusen::inflate()