library(stUPscales)
library(EmiStatR)
# definition of the first summary.agg object
data("P1")
P1 <- P1[1:1100,]
new_data <- matrix(data = NA, nrow = nrow(P1), ncol = 55)
for(i in 1:55){
new_data[,i] <- matrix(data = rnorm(nrow(P1), 45, 15),
nrow = nrow(P1), ncol = 1)
}
new_data <- t(new_data)
new_summary <- MC.summary(p1 = P1, data = new_data)
# deterministic simulation
det <- rnorm(nrow(P1), 45, 15)
det <- cbind(det, rnorm(nrow(P1), 55, 23))
colnames(det) <- c("det1", "det2")
# level of aggregation
delta <- 60*2 # 2 hours
new_summary_agg <- MC.summary.agg(summ = new_summary, det, delta,
func.agg = mean, func.agg.p = sum)
# definition of the second summary.agg object
new_data1 <- matrix(data = NA, nrow = nrow(P1), ncol = 55)
for(i in 1:55){
new_data1[,i] <- matrix(data = rnorm(nrow(P1), 55, 23),
nrow = nrow(P1), ncol = 1)
}
new_data1 <- t(new_data1)
new_summary1 <- MC.summary(p1 = P1, data = new_data1)
new_summary_agg1 <- MC.summary.agg(summ = new_summary1, det, delta,
func.agg = mean, func.agg.p = sum)
## not run
## creating the plot for the event (uncomment to run)
#PlotMC.event(summ = new_summary_agg, summ1 = new_summary_agg1, obs = 0,
# det.var = "det1", det.var1 = "det2", namePlot = "ExamplePlot",
# ylab = "Variable 1 [units]", ylab1 = "Variable 2 [units]",
# ntick=10, qUpper= "q95")
#Run the code above in your browser using DataLab