ggplotR/00_mfd.R
geom_mfd.RdCreates a geom layer to plot a Multivariate Functional Data Object
with ggplot
geom_mfd(
mapping = NULL,
data = NULL,
mfdobj,
stat = "identity",
position = "identity",
na.rm = TRUE,
orientation = NA,
show.legend = NA,
inherit.aes = TRUE,
type_mfd = "mfd",
...
)Set of aesthetic mappings additional
to x and y as passed to the function ggplot2::geom:line.
A data.frame providing columns
to create additional aesthetic mappings.
It must contain a column "id" with the replication values
as in mfdobj$fdnames[[2]].
If it contains a column "var", this must contain
the functional variables as in mfdobj$fdnames[[3]].
A multivariate functional data object of class mfd.
See ggplot2::geom_line.
See ggplot2::geom_line.
See ggplot2::geom_line.
See ggplot2::geom_line.
See ggplot2::geom_line.
See ggplot2::geom_line.
A character value equal to "mfd" or "raw". If "mfd", the smoothed functional data are plotted, if "raw", the original discrete data are plotted.
See ggplot2::geom_line.
A geom_line layer to be added to
ggplot2::ggplot()in order to plot mfdobj.
library(funcharts)
mfdobj <- data_sim_mfd()
ids <- mfdobj$fdnames[[2]]
df <- data.frame(id = ids, first_two_obs = ids %in% c("rep1", "rep2"))
ggplot() +
geom_mfd(mapping = aes(colour = first_two_obs),
data = df,
mfdobj = mfdobj)