ggcosinor {card}R Documentation

ggplot of cosinor model


ggplot of cosinor model that can visualize a variety of cosinor model subtypes, including single-component, multiple-component, individual, and population cosinor models, built using card::cosinor. For single component cosinor, the following values are plotted:

If using a multiple-component cosinor, the terms are different. If the periods or frequencies resonate or are harmonic, then the following are calculated. If the periods are not harmonic, the values are just descriptors of the curve.


ggcosinor(object, labels = TRUE, ...)



Model of class cosinor. If instead of a single cosinor model, multiple objects are to be plotted, can provide a list of cosinor models. Plotting multiple models simultaneously is preferred if the outcome variable is similar in scale.


Logical value if annotations should be placed on plot, default = TRUE. The labels depend on the type of plot. The labels are attempted to be placed "smartly" using the ggrepel::geom_label_repel() function.


For extensibility. This function will use different implementations based on the type of model (single or multiple component). Attributes of the object will be passed down, or calculated on the fly.


Object of class ggplot that can be layered

See Also

Other cosinor: augment.cosinor(), cosinor()


m1 <- cosinor(rDYX ~ hour, twins, tau = 24)
m2 <- cosinor(rDYX ~ hour, twins, tau = c(24, 12))
ggcosinor(m1, labels = FALSE)
ggcosinor(list(single = m1, multiple = m2))

[Package card version 0.1.0 Index]