| Title: | Animated Biplots |
|---|---|
| Description: | Create animated biplots that enables dynamic visualisation of temporal or sequential changes in multivariate data by animating a single biplot across the levels of a time variable. It builds on objects from the 'biplotEZ' package, Lubbe S, le Roux N, Nienkemper-Swanepoel J, Ganey R, Buys R, Adams Z, Manefeldt P (2024) <doi:10.32614/CRAN.package.biplotEZ>, allowing users to create animated biplots that reveal how both samples and variables evolve over time. |
| Authors: | Raeesa Ganey [aut, cre, cph] (ORCID: <https://orcid.org/0009-0008-6973-0999>), Johané Nienkemper-Swanepoel [aut, cph] (ORCID: <https://orcid.org/0000-0001-6086-8272>) |
| Maintainer: | Raeesa Ganey <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.0 |
| Built: | 2026-05-21 10:44:58 UTC |
| Source: | https://github.com/muvisu/moveez |
Calibrate axis
.calibrate.axis( j, Xhat, means, sd, axes.rows, ax.which, ax.tickvec, ax.orthogxvec, ax.orthogyvec ).calibrate.axis( j, Xhat, means, sd, axes.rows, ax.which, ax.tickvec, ax.orthogxvec, ax.orthogyvec )
j |
j |
Xhat |
Xhat |
means |
means |
sd |
sd |
axes.rows |
axes.rows |
ax.which |
ax.which |
ax.tickvec |
ax.tickvec |
ax.orthogxvec |
ax.orthogxvec |
ax.orthogyvec |
ax.orothogyvec |
Calibrated axes
Data extracted from ERA5 hourly data on single levels from 1940 to present
A dataset with 960 observations and 9 variables.
8 years from 1950 to 2020
12 calendar months
10 IPCC climate reference regions
Accumulated precipitation
Daily evaporation
Mean temperature
Soil moisture
6-month standardised precipitation index
Windspeed
DOI: 10.24381/cds.adbb2d47 (Accessed on 11-02-2025)
Data extracted from ERA5 hourly data on single levels for 1989
A dataset with 120 observations and 9 variables.
8 years from 1950 to 2020
12 calendar months
10 IPCC climate reference regions
Accumulated precipitation
Daily evaporation
Mean temperature
Soil moisture
6-month standardised precipitation index
Windspeed
DOI: 10.24381/cds.adbb2d47 (Accessed on 11-02-2025)
Provide axes coordinates
axes_moveEZ(bp, which.var)axes_moveEZ(bp, which.var)
bp |
Object |
which.var |
which variable(s) to find coordinates |
Axes coordinates
This function calculates measures of comparison after generalised orthogonal Procrustes Analysis
is performed in moveplot3. Orthogonal Procrustes Analysis is used to compare a target to a testee configuration.
The following measures are calculate: Procrustes Statistic (PS), Congruence Coefficient (CC), Absolute Mean Bias (AMB),
Mean Bias (MB) and Root Mean Squared Bias (RMSB).
evaluation(bp, centring = TRUE)evaluation(bp, centring = TRUE)
bp |
biplot object from |
centring |
logical argument to apply centring or not (default is |
eval.tab |
Returns a table of the measures of comparison for each level of the time variable compared to the target. |
fit.plot |
Returns a line plot with the fit measures that are bounded between zero and one: PS and CC. A small PS value and large CC value indicate good fit. |
bias.plot |
Returns a line plot with bias measures that are unbounded: AMB, MB and RMSB. Small values indicate low bias. |
data(Africa_climate) data(Africa_climate_target) bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA() results <- bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) |> evaluation() results$eval.tab results$fit.plot results$bias.plot data(Africa_climate) data(Africa_climate_target) bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA() results <- bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target) |> evaluation() results$eval.tab results$fit.plot results$bias.plotdata(Africa_climate) data(Africa_climate_target) bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA() results <- bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) |> evaluation() results$eval.tab results$fit.plot results$bias.plot data(Africa_climate) data(Africa_climate_target) bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA() results <- bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target) |> evaluation() results$eval.tab results$fit.plot results$bias.plot
Create animated biplot on samples in a biplot
Create animated biplot on samples in a biplot
moveplot( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, shadow = FALSE ) moveplot( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, shadow = FALSE )moveplot( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, shadow = FALSE ) moveplot( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, shadow = FALSE )
bp |
biplot object from biplotEZ |
time.var |
time variable |
group.var |
group variable |
move |
whether to animate (TRUE) or facet (FALSE) samples, according to time.var |
hulls |
whether to display sample points or convex hulls |
scale.var |
scaling the vectors representing the variables |
shadow |
whether the animation will keep past states (only when hulls = FALSE) |
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() # Convex hulls facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Samples facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours with colour palette in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = RColorBrewer::brewer.pal(10, "Paired")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Specifying plotting characters for grouping variable in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(pch = c(19, 21, 3)) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying opacity of plotting characters and size of variable lables bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(opacity = 0.4) |> axes(label.cex = 1.2) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours manually in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = c("firebrick4", "indianred3", "tomato", "sandybrown", "khaki1", "palegreen1", "darkseagreen2", "mediumaquamarine", "deepskyblue4", "mediumpurple4")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Convex hulls move plot if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Samples move plot with shadows if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = TRUE, shadow = TRUE)} data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() # Convex hulls facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Samples facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours with colour palette in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = RColorBrewer::brewer.pal(10, "Paired")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Specifying plotting characters for grouping variable in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(pch = c(19, 21, 3)) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying opacity of plotting characters and size of variable lables bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(opacity = 0.4) |> axes(label.cex = 1.2) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours manually in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = c("firebrick4", "indianred3", "tomato", "sandybrown", "khaki1", "palegreen1", "darkseagreen2", "mediumaquamarine", "deepskyblue4", "mediumpurple4")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Extracting measures of fit of PCA bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() |> fit.measures() bp <- bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity # Convex hulls move plot if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Samples move plot with shadows if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = TRUE, shadow = TRUE)} # CVA biplot bp <- biplot(Africa_climate, scaled = TRUE) |> CVA(class = Africa_climate$Region) bp |> moveplot2(group.var = "Region", time.var = "Year", move = FALSE) # Extracting measures of fit of CVA bp <- biplot(Africa_climate, scaled = TRUE) |> CVA(classes = Africa_climate$Region) |> fit.measures() bp <- bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity bp$within.class.axis.predictivity bp$within.class.sample.predictivitydata(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() # Convex hulls facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Samples facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours with colour palette in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = RColorBrewer::brewer.pal(10, "Paired")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Specifying plotting characters for grouping variable in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(pch = c(19, 21, 3)) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying opacity of plotting characters and size of variable lables bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(opacity = 0.4) |> axes(label.cex = 1.2) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours manually in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = c("firebrick4", "indianred3", "tomato", "sandybrown", "khaki1", "palegreen1", "darkseagreen2", "mediumaquamarine", "deepskyblue4", "mediumpurple4")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Convex hulls move plot if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Samples move plot with shadows if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = TRUE, shadow = TRUE)} data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() # Convex hulls facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Samples facet plot bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours with colour palette in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = RColorBrewer::brewer.pal(10, "Paired")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Specifying plotting characters for grouping variable in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(pch = c(19, 21, 3)) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying opacity of plotting characters and size of variable lables bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(opacity = 0.4) |> axes(label.cex = 1.2) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE) # Specifying colours manually in biplotEZ bp <- biplot(Africa_climate, scaled = TRUE, group.aes = Africa_climate$Region) |> PCA() |> samples(col = c("firebrick4", "indianred3", "tomato", "sandybrown", "khaki1", "palegreen1", "darkseagreen2", "mediumaquamarine", "deepskyblue4", "mediumpurple4")) bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) # Extracting measures of fit of PCA bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() |> fit.measures() bp <- bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity # Convex hulls move plot if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Samples move plot with shadows if(interactive()) { bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = TRUE, shadow = TRUE)} # CVA biplot bp <- biplot(Africa_climate, scaled = TRUE) |> CVA(class = Africa_climate$Region) bp |> moveplot2(group.var = "Region", time.var = "Year", move = FALSE) # Extracting measures of fit of CVA bp <- biplot(Africa_climate, scaled = TRUE) |> CVA(classes = Africa_climate$Region) |> fit.measures() bp <- bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity bp$within.class.axis.predictivity bp$within.class.sample.predictivity
Create animated biplot on samples and variables in a biplot
Create animated biplot on samples and variables in a biplot
moveplot2( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, align.time = NA, reflect = NA ) moveplot2( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, align.time = NA, reflect = NA )moveplot2( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, align.time = NA, reflect = NA ) moveplot2( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, align.time = NA, reflect = NA )
bp |
biplot object from biplotEZ |
time.var |
time variable |
group.var |
group variable |
move |
whether to animate (TRUE) or facet (FALSE) samples and variables, according to time.var |
hulls |
whether to display sample points or convex hulls |
scale.var |
scaling the vectors representing the variables |
align.time |
a vector specifying the levels of time.var for which the biplots should be aligned. Only biplots corresponding to these time points will be used to compute the alignment transformation. |
reflect |
a character vector specifying the axis of reflection to apply at each corresponding time point in align.time. One of FALSE (default), "x" for reflection about the x-axis, "y" for reflection about the y-axis and "xy" for reflection about both axes. |
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() if(interactive()) { bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() if(interactive()) { bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Extracting measures of fit for PCA bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity # Extracting measures of fit for CVA bp <- biplot(Africa_climate) |> CVA(classes = Africa_climate$Region) bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity bp$within.class.axis.predictivity bp$within.class.sample.predictivitydata(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() if(interactive()) { bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} data(Africa_climate) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() if(interactive()) { bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)} # Extracting measures of fit for PCA bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity # Extracting measures of fit for CVA bp <- biplot(Africa_climate) |> CVA(classes = Africa_climate$Region) bp <- bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE) bp$quality bp$axis.predictivity bp$within.class.axis.predictivity bp$within.class.sample.predictivity
Create animated biplot on samples and variables in a biplot with a given target
Create animated biplot on samples and variables in a biplot with a given target
moveplot3( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, target = NULL ) moveplot3( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, target = NULL )moveplot3( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, target = NULL ) moveplot3( bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5, target = NULL )
bp |
biplot object from biplotEZ |
time.var |
time variable |
group.var |
group variable |
move |
whether to animate (TRUE) or facet (FALSE) samples and variables, according to time.var |
hulls |
whether to display sample points or convex hulls |
scale.var |
scaling the vectors representing the variables |
target |
Target data set to which all biplots should be matched consisting of the the same dimensions. If not specified, the centroid of all available biplot sample coordinates from |
bp |
Returns the elements of the biplot object |
iter_levels |
The levels of the time variable. |
coord_set |
The coordinates of the configurations before applying Generalised Orthogonal Procrustes Analysis. |
GPA_list |
The coordinates of the configurations after applying Generalised Orthogonal Procrustes Analysis. |
plot |
An animated or a facet of biplots based on the dynamic frame. |
bp |
Returns the elements of the biplot object |
iter_levels |
The levels of the time variable. |
coord_set |
The coordinates of the configurations before applying Generalised Orthogonal Procrustes Analysis. |
GPA_list |
The coordinates of the configurations after applying Generalised Orthogonal Procrustes Analysis. |
plot |
An animated or a facet of biplots based on the dynamic frame. |
data(Africa_climate) data(Africa_climate_target) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) if(interactive()) { bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE, target = NULL)} bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target) data(Africa_climate) data(Africa_climate_target) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) if(interactive()) { bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE, target = NULL)} bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target)data(Africa_climate) data(Africa_climate_target) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) if(interactive()) { bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE, target = NULL)} bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target) data(Africa_climate) data(Africa_climate_target) bp <- biplot(Africa_climate, scaled = TRUE) |> PCA() bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = NULL) if(interactive()) { bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE, target = NULL)} bp |> moveplot3(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE, target = Africa_climate_target)