# NOT RUN {
dt1 <- toy_activity_data()
#all movement after day 3 is set at 0
dt1[t > days(3), moving := FALSE]
# one artefact of movement is detected at day 3.5
dt1[t == days(3.5), moving := TRUE]
dt2 <- curate_dead_animals(dt1)
dt3 <- curate_dead_animals(dt1,prop_immobile = 0)
# }
# NOT RUN {
library(ggplot2)
ggplot(data=dt1[,test:=1],aes(t, as.numeric(moving))) +
geom_line(data=dt1[,test:=1]) +
geom_line(data=dt2[, test:=2])+
geom_line(data=dt3[, test:=3])+
facet_grid(test ~ .)+
scale_x_time()
# }
Run the code above in your browser using DataLab