data(bot)
calibrate_deviations(bot)
## Not run: ------------------------------------
#
# # on Opn
# data(olea)
# calibrate_deviations(olea)
#
# # lets customize the ggplot
# library(ggplot2)
# gg <- calibrate_deviations(bot, id=1:20)$gg
# gg + geom_hline(yintercept=c(0.001, 0.005), linetype=3)
# gg + labs(col="Number of harmonics", fill="Number of harmonics",
# title="Harmonic power") + theme_bw()
# gg + coord_polar()
#
# ### intermediate results can be accessed eg with:
# shp <- hearts[1] %>% coo_interpolate(360) %>% coo_samplerr(60) %>% Out()
# calibrate_deviations(shp, id=1, range=1:24, method="efourier") %$%
# res %>% apply(1, mean) %>% plot(type="b")
# calibrate_deviations(shp, id=1, range=1:24, method="rfourier") %$%
# res %>% apply(1, mean) %>% plot(type="b")
# calibrate_deviations(shp, id=1, range=1:24, method="tfourier") %$%
# res %>% apply(1, mean) %>% plot(type="b")
#
# # ... providing an illustration of the e vs r/t fourier approaches developped in the help page.
#
# ### illustration of interpolate.factor
# interp <- c(1, 5, 25)
# res <- list()
# for (i in seq_along(interp))
# calibrate_deviations(shp, id=1, range=1:24,
# method="tfourier", interpolate.factor=interp[i], plot=FALSE) %$%
# res %>% apply(1, mean) -> res[[i]]
#
# ### int_5 is more accurate than no inteprolation
# sign(res[[2]] - res[[1]])
# ### int 25 is more accurate than int_5, etc.
# sign(res[[3]] - res[[2]])
## ---------------------------------------------
Run the code above in your browser using DataLab