# Example dataset
emission_data <- data.frame(
theatre = c("Theatre A", "Theatre A", "Theatre B", "Theatre B", "Theatre A", "Theatre B"),
emissions = c(200, 250, 150, 180, 300, 220),
date = c("01/01/2023", "01/02/2023", "01/01/2023", "01/02/2023", "01/03/2023", "01/03/2023")
)
# Using the relative_gti function
relative_gti_plot <- relative_gti(
data = emission_data,
time = date,
date_format = "%d/%m/%Y", # Date format used in the dataset
name = theatre,
val = emissions,
gti_by = "default" # Calculating based on default time period
)
# Plot the relative GTI
print(relative_gti_plot)
Run the code above in your browser using DataLab