Title: | Animated Biplots |
Version: | 1.1.0 |
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. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
VignetteBuilder: | knitr |
Depends: | R (≥ 4.1.0) |
Imports: | dplyr, biplotEZ, gganimate, ggplot2, GPAbin |
Suggests: | testthat, rmarkdown, knitr, tibble, scales |
Config/Needs/website: | rmarkdown |
URL: | https://muvisu.github.io/moveEZ/ |
NeedsCompilation: | no |
Packaged: | 2025-08-22 12:13:59 UTC; raeesaganey |
Author: | Raeesa Ganey |
Maintainer: | Raeesa Ganey <raeesa.ganey@wits.ac.za> |
Repository: | CRAN |
Date/Publication: | 2025-08-22 12:40:09 UTC |
moveEZ: 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.
Author(s)
Maintainer: Raeesa Ganey raeesa.ganey@wits.ac.za (ORCID) [copyright holder]
Authors:
Johané Nienkemper-Swanepoel nienkemperj@sun.ac.za (ORCID) [copyright holder]
See Also
Useful links:
Calibrate axis
Description
Calibrate axis
Usage
.calibrate.axis(
j,
Xhat,
means,
sd,
axes.rows,
ax.which,
ax.tickvec,
ax.orthogxvec,
ax.orthogyvec
)
Arguments
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 |
Value
Calibrated axes
Climate studies example dataset
Description
Data extracted from ERA5 hourly data on single levels from 1940 to present
Format
A dataset with 960 observations and 9 variables.
Details
- Year
8 years from 1950 to 2020
- Month
12 calendar months
- Region
10 IPCC climate reference regions
- AccPrec
Accumulated precipitation
- DailyEva
Daily evaporation
- Temp
Mean temperature
- SoilMois
Soil moisture
- SPI6
6-month standardised precipitation index
- wind
Windspeed
Source
DOI: 10.24381/cds.adbb2d47 (Accessed on 11-02-2025)
Climate studies target example dataset
Description
Data extracted from ERA5 hourly data on single levels for 1989
Format
A dataset with 120 observations and 9 variables.
Details
- Year
8 years from 1950 to 2020
- Month
12 calendar months
- Region
10 IPCC climate reference regions
- AccPrec
Accumulated precipitation
- DailyEva
Daily evaporation
- Temp
Mean temperature
- SoilMois
Soil moisture
- SPI6
6-month standardised precipitation index
- wind
Windspeed
Source
DOI: 10.24381/cds.adbb2d47 (Accessed on 11-02-2025)
Provide axes coordinates
Description
Provide axes coordinates
Usage
axes_moveEZ(bp, which.var)
Arguments
bp |
Object |
which.var |
which variable(s) to find coordinates |
Value
Axes coordinates
Measures of comparison for move plot 3
Description
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).
Usage
evaluation(bp, centring = TRUE)
Arguments
bp |
biplot object from |
centring |
logical argument to apply centring or not (default is |
Value
eval.list |
Returns a list containing the measures of comparison for each level of the time variable. |
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 taht are unbounded: AMB, MB and RMSB. Small values indicate low bias. |
Examples
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.list
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.list
results$fit.plot
results$bias.plot
Move plot
Description
Create animated biplot on samples in a biplot
Usage
moveplot(bp, time.var, group.var, move = TRUE, hulls = TRUE, scale.var = 5)
Arguments
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 |
Value
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
Examples
data(Africa_climate)
bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA()
bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = FALSE)
bp |> moveplot(time.var = "Year", group.var = "Region", hulls = FALSE, move = FALSE)
if(interactive()) {
bp |> moveplot(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)}
Move plot 2
Description
Create animated biplot on samples and variables in a biplot
Usage
moveplot2(
bp,
time.var,
group.var,
move = TRUE,
hulls = TRUE,
scale.var = 5,
align.time = NA,
reflect = NA
)
Arguments
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. |
Value
bp |
Returns the elements of the biplot object |
plot |
An animated or a facet of biplots based on the dynamic frame. |
Examples
data(Africa_climate)
bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::PCA()
if(interactive()) {
bp |> moveplot2(time.var = "Year", group.var = "Region", hulls = TRUE, move = TRUE)}
Move plot 3
Description
Create animated biplot on samples and variables in a biplot with a given target
Usage
moveplot3(
bp,
time.var,
group.var,
move = TRUE,
hulls = TRUE,
scale.var = 5,
target = NULL
)
Arguments
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 |
Value
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. |
Examples
data(Africa_climate)
data(Africa_climate_target)
bp <- biplotEZ::biplot(Africa_climate, scaled = TRUE) |> biplotEZ::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)