# load example data
dat <- read_hdx(system.file(package = "HaDeX", "HaDeX/data/KD_180110_CD160_HVEM.csv"))
# calculate mean uncertainty
(result <- quality_control(dat = dat,
state_first = "CD160",
state_second = "CD160_HVEM",
chosen_time = 1,
in_time = 0.001))
# load extra libraries
library(ggplot2)
library(tidyr)
library(dplyr)
# example of data visualization
gather(result, 2:7, key = 'type', value = 'value') %>%
filter(startsWith(type, "avg")) %>%
ggplot(aes(x = factor(out_time), y = value, group = type)) +
geom_line(aes(color = type)) +
labs(x = "Out time",
y = "Mean uncertainty")
Run the code above in your browser using DataLab