Passer au contenu

This function generates an ombrothermic plot from meteo data stored in the self$meteo attribute of the user_data object. It displays daily rainfall (in mm) as bars and daily minimum, mean, and maximum temperatures (in °C) as lines.

The x-axis shows the months (horizontal labels) and the specific dates where rainfall exceeded 5 mm (vertical labels aligned below the axis).

Utilisation

plot_meteo(
  self,
  start_day = NULL,
  end_day = NULL,
  rain_date_labels = TRUE,
  ppp_marks = TRUE,
  obs_marks = TRUE
)

Arguments

self

A user_data R6 object containing a meteo data.frame

start_day

Optional start date for filtering the data (format YYYY-MM-DD or DD/MM/YYYY).

end_day

Optional end date for filtering the data.

rain_date_labels

Logical, default TRUE. If TRUE, adds date labels above rainfall bars where rain_mm > 5.

ppp_marks

Logical, default TRUE. If TRUE, draws treatment markers using unique dates found in self$metadata$ppp$p_app_date within the filtered range.

obs_marks

Logical, default TRUE. If TRUE, draws observation markers using unique observation_date values merged from all data frames in self$obs_data within the filtered range.

Valeur de retour

A ggplot object representing the ombrothermic chart. The used data (after cleaning and filtering) is attached as an attribute "data_used".

Exemples

if (FALSE) { # \dontrun{
# example code
# where mydata is the object into which the user_data class has been loaded
mydata <- user_data$new(trial_file = "path to our trial file")

plot_meteo(mydata,
   start_day = "01/04/2025",
   end_day = "30/07/2025",
   rain_date_labels = FALSE)
} # }