BiplotGUI : Interactive Biplots in R

Biplots simultaneously provide information on both the samples and the variables of a data matrix in two- or three-dimensional representations. The BiplotGUI package provides a graphical user interface for the construction of, interaction with, and manipulation of biplots in R . The samples are represented as points, with coordinates determined either by the choice of biplot, principal coordinate analysis or multidimensional scaling. Various transformations and dissimilarity metrics are available. Information on the original variables is incorporated by linear or non-linear calibrated axes. Goodness-of-ﬁt measures are provided. Additional descriptors can be superimposed, including convex hulls, alpha-bags, point densities and classiﬁcation regions. Amongst the interactive features are dynamic variable value prediction, zooming and point and axis drag-and-drop. Output can easily be exported to the R workspace for further manipulation. Three-dimensional biplots are incorporated via the rgl package. The user requires almost no knowledge of R syntax.


Introduction
In this section we give a brief overview of biplots, existing biplot software, and the statistical programming language and environment R. In Section 2 we set out the main aims of the BiplotGUI package, while its most important features are showcased in Sections 3 and 4 through the exploration of three data sets. Further features are illustrated in Section 5. In Section 6 we list some ideas for future releases. The present version of the package is 0.0-4.1.
The article is intentionally non-mathematical. This allows the focus to lie firmly with the package and its features. However, detailed references are provided for those who wish to gain a fuller understanding of the underlying theory. In addition, the main computations performed by the package are set out in Appendix A.

Biplots
Introduced by Gabriel (1971), the biplot is described by Gower and Hand (1996) in their authoritative monograph as the multivariate analogue of the ordinary scatter plot. As such, biplots are representations of multivariate data in which information on both the samples (observations) and the variables of a data matrix is given simultaneously in two or three dimensions: the samples are represented as points, while the variables are represented as labelled, calibrated axes. The axes are either linear and oblique, or non-linear. This new approach to biplots differs from the more traditional approach in which samples and variables are represented as points and/or uncalibrated vectors.
The placement of the axes depends partly on the mechanism used in the placement of the points. The PCA biplot provides linear axes for points placed by PCA (Gower and Hand 1996, Chapter 2); similarly the CVA biplot provides linear axes for points placed by CVA (Gabriel 1972;Gower and Hand 1996, Chapter 5). The regression biplot (Gower and Hand 1996, Chapter 3) gives approximate linear axes for any ordination of points. So too does the Procrustes biplot (Gower and Hand 1996, Chapter 3). The regression and Procrustes biplots correspond to the PCA biplot for points determined by PCO based on Pythagorean dissimilarities. The covariance biplot (Greenacre 1984;Underhill 1990) adjusts the points and axes of the PCA biplot so that the cosines of the angles between the axes approximate the correlations between the corresponding variables. The correlation biplot is similar, except that the variables are first scaled to have unit variances.
The placement of the axes may also depend on how they are to be used. Predictive axes are positioned and calibrated so that the orthogonal projection of a point onto an axis 'predicts' as best as is graphically possible the value of the corresponding sample on the corresponding variable. Interpolative axes, on the other hand, are positioned and calibrated so that a new sample may be added to an existing configuration of points at the most appropriate position graphically possible. Interpolation can be either by the centroid or vector sum of the positions on the axes corresponding to the respective variable values of the new sample.
For additive inter-sample dissimilarities (Gower and Hand 1996, p. 105), biplots with nonlinear axes (or trajectories) may be constructed for points determined by PCO. The PCO solution itself requires the inter-sample dissimilarities to be Euclidean-embeddable (Gower 1982); dissimilarity measures for which this is the case are discussed by Gower and Legendre (1986). Non-linear predictive axes may make use of circular projection (Gower and Hand 1996, Chapter 6), while non-linear interpolative axes (Gower and Harding 1988;Gower and Hand 1996, Chapter 6) are used in the same way as the linear variety. Non-linear biplots are often most useful to gauge what is otherwise approximated by linear biplots.
While very many examples of biplots of the traditional approach may be found in the literature, there are fewer examples of biplots of the new approach. An important reason has been the lack of software, as is discussed in Sections 1.2 and 1.3. The value of biplots of the new approach, however, has often been demonstrated. In an easy to read introduction, for example, Le  cite and showcase many examples of the uses of linear biplots, from such diverse fields as archaeology, agriculture, antiques, education, financial management, mineralogy and process control. Other recent fields of application include cephalometry (Naidoo et al. 2006), chemistry (Alves et al. 2005) and mineralogy (Jemwa and Aldrich 2006). Examples of non-linear biplots may be found in Gower and Harding (1988), Gower and Hand (1996), Cox and Cox (2001) and Gower and Ngouenet (2005).
Given the ubiquity of multivariate data and the usefulness of biplots in describing such data, there is still much scope for the further popularization of the technique.

Existing biplot software
Many statistical packages can be used to produce at least the simplest of biplots of the traditional approach. These include the major statistical packages Minitab (Minitab Inc 2007), SPSS (SPSS Inc 2008), Stata (StataCorp LP 2007) and various products from SAS (SAS Institute Inc 2009). However, functionality is often limited, and the results hard to obtain. Greater functionality is provided by the three dedicated biplot programs XLS-Biplot (Udina 2005a,b), GGEBiplot (Yan and Kang 2006) and BiPlot (Lipkovich and Smith 2002a,b). XLS-Biplot is based on XLisp-Stat (Tierney 1990) and has many useful features including a related web-server that can be used to construct biplots online. GGEbiplot is aimed mainly at agronomists, crop scientists and geneticists. It supplements the book by Yan and Kang (2003). BiPlot is an add-on for Excel, and although therefore potentially widely useful, it unfortunately has some minor but serious shortcomings (see Udina 2005b).
The Genstat package (VSN International Ltd 2008) can be used to calculate the coordinates of the elements of a biplot. These can then be drawn using a procedure from an add-on library. Other packages, offering some traditional biplot functionality, include Manet (Hofmann 2000)

R
R (R Development Core Team 2009) is a free statistical programming language and environment capable of producing high-quality graphics. Initiated by Ihaka and Gentleman (1996), it has become 'the de facto standard for statistical computing' (Greenacre 2007, p. 213). It is an open-source implementation of the S programming language, available for download for all the major platforms from the R project home page at http://www.R-project.org/. The R core is updated regularly with minor version revisions released roughly every six months. The current version (as of April 2009) is R 2.9.0. Updates are relatively painless. R is easily extensible: a large number of user-written packages is available for download from repositories such as the Comprehensive R Archive Network (CRAN, http://CRAN.R-project.org/) and Bioconductor (http://www.bioconductor.org/). These repositories can be accessed via the R project home page (see also Appendix B). As R has increased in popularity, so too has the number of books devoted to it. Recent general-topic books on R include Braun andMurdoch (2007), Chambers (2007) and Spector (2008). The book by Murrel (2005) deals specifically with graphics in R. Many more resources are freely available from the R Project home page.
As far as biplots are concerned, the biplot method in R can be used to produce two variations of Gabriel's (1971) classical biplot. The classical biplot is most similar to the covariance/correlation biplot described earlier. Packages with support for traditional biplots include ade4 (Dray and Dufour 2007), ade4TkGUI (Thioulouse and Dray 2009, 2007, bpca (Faria and Demetrio 2008) and vegan (Oksanen et al. 2009). In addition, the calibrate package (Graffelman 2009) can be used to calibrate both scatter plot and biplot axes as described by Graffelman and van Eeuwijk (2005). In general, however, these calibrations do not correspond to those of Gower and Hand (1996).
As opposed to the many solutions for biplots of the traditional approach listed in this section and in the previous one, software for biplots of the new approach has not been readily available. To produce biplots of the new approach, users have had to do their own programming in a suitable environment (for example, Gardner 2001). To many potential users, such a task represents a major obstacle.

A new package
The primary aim with the BiplotGUI package is to make it easy to construct biplots of the kind advocated by Gower and Hand (1996) -biplots in which samples are represented as points and variables are represented as calibrated axes. The package goes beyond this, however, allowing users to interact with the data through the biplots which are produced. Naturally, the graphical output should be of a high quality, and the graphs easily customisable. Its characteristics make R the ideal environment for the development of such a package.
In the next two sections, the most important features of the BiplotGUI package are illustrated. This is done through the exploration of three data sets. Further features are highlighted in Section 5. A systematic account of all features is given in the 'Details' chapter of the package manual. This manual can be accessed via the Help menu from within the package. The package does not currently support biplots of categorical variables. Further resources and tools are available via the package home page at http://biplotgui.R-Forge.R-project.org/.

A first example
In this section we introduce a country-comparative data set. It is used to show how the graphical user interace (GUI) of the package may be initialized, how its features are laid out, and how it may be used to explore multivariate data using, amongst other things, PCA and regression biplots.   ). The aim is to represent these data in two or three dimensions so that a single, multivariate visual impression may be obtained, with the calibrated biplot axes incorporating information on the original variables.

Getting started
After R has been downloaded and installed, it is also necessary to install the BiplotGUI package and its dependencies (details are provided in Appendix B). This process needs to be performed only once. To then load the BiplotGUI package into R, the following command is entered at the R prompt, followed as usual by the enter key:

R> library("BiplotGUI")
If the user is acquainted with R, data may be entered at the keyboard or be imported into R and saved as a matrix or a data frame. The country data have already been included in the package as a data frame, and may be viewed from within R by typing the commands R> data("Countries") R> Countries at the R prompt. To initialize the GUI with the country data, the command R> Biplots(Data = Countries) is entered. No further R commands are needed. Figure 1 shows the layout of the GUI after it has launched. Six regions are indicated:

The layout
The menu bar, in addition to the settings box, contains the most important options. The menu bar options are laid out in full in The biplot region is where the biplot and optional title and legend are displayed. This space is responsive to mouse clicks and motion.
The settings box may be used to set the action of the biplot axes, either predictive, centroid interpolative or vector sum interpolative. Various data transformations may be effected.
The diagnostics tabs show output related to the currently displayed biplot. The Convergence tab shows a graph of convergence; the Points, Groups and Axes tabs show context-specific graphs of goodness-of-fit for points, groups and axes, respectively;  the Predictions tab shows dynamically predicted variable values; while the Export tab allows various objects to be exported to R.
The kraal is where points and axes may be kept, temporarily removing them from consideration.
Other. The options in this section can be used to show the currently displayed biplot in an external window (in two or three dimensions), to control the biplot region or to control the kraal. While the GUI is busy, a progress bar is shown towards the left of this area.
The Show pop-up help option in the Help menu activates pop-up help messages which appear when the mouse cursor is hovered over the components of the main GUI window.

Exploring
The PCA biplot with predictive axes is shown by default. For the country data, this is the biplot shown towards the left of the screenshot in Figure 1. As should be the case for all biplots, a unit aspect ratio is used to ensure that distances within the biplot are properly represented. In this biplot, the points representing the countries lie ordered along a virtually straight line. In fact, the imagined line corresponds very closely to the biplot axis for GDP, and importantly, the line is almost horizontal. The reason for this becomes clear by looking at the GDP column of the country data set. The values of GDP are orders larger than those of the other variables. Therefore, that linear combination of the variables that has the largest possible variation (the first principal component) is heavily weighted towards GDP. In effect, GDP drowns out the other variables. To avoid this, we choose the Centre, scale transformation from the available transformations in the settings box. This transformation independently transforms each variable to unit variance and automatically updates the biplot to the one shown in the top left panel of Figure 2 (see Appendix A.2 for details on the calculations involved). Irrespective of the chosen transformation, however, the axes are always calibrated in terms of the original variable values. The first principal component in this new figure still ranks the countries from least to most wealthy, in some more complicated sense. The developed countries of the West, together with Japan and newly-industrialized South Korea, cluster in the south-east quadrant. Brazil, Russia and Indonesia lie more towards the west, with Mexico straddling the divide. India, and especially China, lie further away.
While the relative positions of the points are interesting, biplots come into their own when the points are related to their original variable values through the axes. By right clicking inside the predictive linear biplot and selecting Predict cursor positions from the pop-up menu, an array of orthogonally projecting lines emanates from, and follows, the cursor as it moves over the biplot. If Predict points closest to cursor positions is selected instead, the lines project from the point closest to the cursor as it moves, rather than from the cursor itself. So for example, the image in the top right panel of Figure 2 was created by hovering the cursor closer to the point for China than to any other point. These orthogonally projecting lines intersect the axes at the positions at which the optimal approximations to the original variables values are to be read off. It can be seen from the image that China scores relatively low on all the variables except population and military spending. As the cursor moves, these predictions are also given numerically, in real time, in the Predictions tab. Dynamic prediction is disabled by right clicking inside the biplot and selecting Don't predict from the pop-up menu. (Some numerical predictions are given below.) Notice that although the predictions are optimal, they remain approximations. An unfortunate consequence is that values close to zero on variables measured on the ratio scale can have negative predicted values. For example, in Figure 2 the population of Spain is predicted to be less than zero.
With many variables, a biplot may become crowded. A particular axis can be highlighted by right clicking it and then selecting Highlight from the pop-up menu. Doing so greys the other axes, and displays the true variable values of the highlighted axis above the corresponding points. The displays in the diagnostic tabs are shaded accordingly and orthogonal projections are drawn to the highlighted axis only. An example is shown in the centre panel of Figure 2, where GDP is highlighted and China is predicted.
The question of course, is how good the biplot approximation is. This depends on both the points and the axes. As for the points, the 'quality' of the PCA approximation is found by clicking to the Export tab, selecting quality, and then clicking Display in console to display the result in the R console, or otherwise clicking Save to Workspace to save the result as an object in the R workspace. In the case of the country data, the quality, 0.693, implies that 69.3% of the variation in the samples is accounted for by the first two principal components. Point and axis predictivities may also be calculated . Predictivities indicate how well individual points or axes are represented in various dimensions of the biplot. Diagrams of point and axis predictivities are available in the Points and Axes tabs, respectively. Those for the country data are shown in the bottom panels of Figure 2. The points and axes in these figures always appear above the diagonal in the unit square. The further to the right a point or axis appears, the better represented it is in the first (or horizontal) biplot dimension. The closer to the top of the diagram, the better the point or axis is represented overall in the biplot, taking into account the contribution of both the first and the second (vertical) biplot dimension. The marginal contribution of the second biplot dimension is indicated by the vertical distance between the diagonal line and the point or axis. This interpretation suggests that India, Canada and Brazil are relatively well represented in the first biplot dimension. Japan, Germany and Indonesia are represented reasonably in the first dimension, but poorly in the second. France, the United States and Russia are poorly represented overall, and Mexico extremely poorly. China is the best represented country overall. The axes may be similarly interpreted. The two diagrams were saved by right clicking them in the GUI, then making use of the Save as options in the pop-up menu. Predictivities are also available numerically from the Export tab. The formulae for quality, point predictivities and axis predictivities for PCA biplots are given in Appendix A.3.
Another measure of the goodness of the approximation is its relative absolute error, which may be calculated for any sample on any variable. The relative absolute error is defined to be the absolute difference between the predicted and actual values, expressed as a percentage of the range (max − min) of the actual values of the particular variable. For GDP, for example, the following output is obtained for the country data by selecting Pred from the Export tab: For a biplot to be usable in printed form, it must necessarily be two-dimensional. However, assisted by a computer, a user may easily interact with a biplot in three dimensions. Threedimensional, non-MDS biplots may be obtained in the BiplotGUI package by clicking the External menu button at the bottom left of the GUI and then selecting the In 3D option. Alternatively, the user may simply press the F12 shortcut key shown alongside the option. Doing so renders the three-dimensional version of the currently displayed two-dimensional biplot in an external window. This feature makes use of the rgl package (Adler and Murdoch 2009) and allows the biplot to be rotated and enlarged dynamically. Figure 3 shows the three-dimensional predictive PCA biplot of the country data that corresponds to the twodimensional version at the top left of Figure 2. A further 12.9% of the total variation in the samples is accounted for in the additional dimension -the third value from eigen in the Export tab divided by the sum of the eigenvalues. An initial 360 degree 'fly-by' of threedimensional biplots can be enabled via the File → Options dialogue box.
A PCA approximation results from the projection of samples onto the plane of best fit. In a covariance biplot (Joint → Covariance/Correlation), these 'scores' are adjusted so that the cosines of the angles between the biplot axes approximate the correlations between the corresponding variables. The correlation biplot is the same as the covariance biplot, but with the variables first scaled to have unit variances (via the settings box, in the usual manner). The correlation biplot of the country data is shown in the top left panel of Figure 4. Three HIV/Aids prevalence, unemployment; population, military spending.
The computations underlying these biplots are set out in Appendix A.4. Notice that the labels of the axes are attached to those ends of the axes that have the higher calibrations. This is the default option for all linear biplots. Alternatively, the axis labels may be given in a legend underneath the biplot, or no axis labels may be given whatsoever. These and other similar options may be set via the View menu. Notice also that the option Joint → CVA is disabled since the samples of the country data have not been grouped in any way, for example by continent. We return to CVA biplots in Section 4.1, where the samples of the antique furniture data set are grouped, and where group differences are investigated.
As opposed to dimension reduction by projection, in MDS the points are chosen so that stress, the sum of the squared differences between the inter-sample disparities and the inter-point distances, is explicitly minimized (details in Appendix A.8). The Points → MDS menu gives various options. These include taking the inter-sample disparities to be the inter-sample dissimilarities themselves (the identity transformation); retaining merely the order of the inter-sample dissimilarities by optimally transforming them into disparities (monotone regression, Kruskal 1964b); or monotonically smoothing the inter-sample dissimilarities into disparities (the monotone spline transformation, Ramsey 1982Ramsey , 1988. Therefore metric, non-metric and semi-metric MDS representations are available. The inter-sample dissimilarities are calculated according to the chosen dissimilarity metric (Appendix A.6). Four metrics are currently available from the Points → Dissimilarity metric menu: Pythagoras, Square-root-of-Manhattan, Clark and Mahalanobis. Inter-point distances are always Pythagorean. An iterative majorization (IM) algorithm (De Leeuw 1977;De Leeuw and Heiser 1980) is used to find the MDS solutions. The IM algorithm converges uniformly, and usually leads to a local minimum, although in theory a saddle-point cannot be ruled out.
The top right panel of Figure 4 shows a metric MDS of the country data, expressed in terms of its principal axes, with approximate regression biplot axes superimposed (from Points → MDS → In terms of principal axes, thereafter Points → MDS → Identity transformation). The default dissimilarity metric, Pythagoras, is retained. In this representation, the relative distances between the points are directly related to the corresponding dissimilarities between the countries. The United Kingdom and South Korea, therefore, are more similar to one another than they are to the other countries with respect to the eight variables. As the algorithm converges, updates of the configuration are shown in the biplot region, together with updates of the graphs in the diagnostic tabs. The Live updates option, however, may be disabled to increase the speed at which the algorithm runs (the checkbox in question is amongst the buttons at the bottom of the GUI). A graph of the stress values over iterations is given in the Convergence tab; in this instance, from the Export tab, convergence is reached after 96 iterations, with a final stress value of 45.8. By default, the IM algorithm is taken to have converged as soon as the relative decrease in stress is lower than 10 −6 . The algorithm is also stopped once more than 5 000 iterations have been performed. These options can be adjusted via the File → Options dialogue box. A Shepard diagram (Borg and Groenen 2005, Section 3.3;Shepard 1962) can be found in the Points tab and is shown at the centre of Figure 4. Each circle in the Shepard diagram represents a pair of samples. The horizontal axis indicates the inter-sample dissimilarity; the vertical axis indicates the corresponding inter-point distance. The blue dots on the yellow line (which generalizes to a step function or a curve) indicate the disparities. Thus the closer the circles are to the line (or step function or curve), the better the overall fit. The five worst-fitting point pairs are identified in the top left corner of the diagram. The dissimilarity between China and Russia, therefore, is most poorly approximated by the points. The Points → MDS → Random initial configuration option forces the algorithm to start from a random configuration at each run; a new run is initiated by clicking Points → MDS → Run or by re-clicking Points → MDS → Identity transformation. Otherwise, the last PCO or MDS solution is taken to be the new initial configuration, as is the case for Figure 4.
To conclude with the country data, suppose that we feel that China is in many ways atypical, and that we would like to see what the effect would be of removing it from consideration. To do so we need simply 'drag' the point representing China from the biplot into the kraal. We may also right click the point representing China and select Send to kraal from the pop-up menu. The biplot region is then automatically updated as if China were never part of the data set. The updated biplot is given in the bottom left panel of Figure 4. Russia's position relative to the other countries seems to have been most greatly affected. There has also been a re-alignment amongst the axes, most notably the axes for HIV/Aids, population and unemployment. Axes may also be removed to the kraal. Points and axes which have been removed to the kraal may be dragged back onto the biplot, or the kraal may be emptied of its points only, its axes only, or of both its points and axes simultaneously by making use of the buttons below it, or by right clicking inside it and selecting the desired option from the pop-up menu. At any stage, the points and/or axes of any representation may be hidden by clicking on the options in the Hide menu button at the bottom of the window. The figure at the bottom right of Figure 4 is the same as the one in the bottom left panel, but with the biplot axes hidden as described.

Two more examples
In this section we consider two more examples. In Section 4.1 we focus our attention on grouped data by investigating antique furniture, while non-linear prediction is illustrated in Section 4.2 at the hand of fighter aircraft data.

Antique furniture
It is often of great interest to collectors, auctioneers and cultural historians to be able to correctly identify the type of wood used to make antique furniture. In the period between 1652 and 1900, wood from both the indigenous Ocotea bullata ('Stinkwood') and the imported Ocotea porosa ('Imbuia') were used to make Old-Cape furniture in South Africa. Being from the same genus and family (Lauraceae), it is often difficult to distinguish between the two types of wood based solely on a traditional analysis of colour, smell, and other observable characteristics. Burden et al. (2001) and Le  make use of CVA biplots of anatomical measurements to distinguish between the species. A third species, Ocotea kenyensis, is also included in the analyses. The microscopically measured variables are: tangential vessel diameter in µm (VesD); vessel element length in µm (VesL); fibre length in µm (FibL); ray height in µm (RayH); ray width in µm (RayW); and the number of vessels per mm 2 (NumVes). The 37 observations are the mean values over fifty repeatmeasurements made on 20 samples of Ocotea bullata, 10 samples of Ocotea porosa, and 7 samples of Ocotea kenyensis. The data are included in the BiplotGUI package as the data frame AntiqueFurniture, of which the first column contains the group specifications. The data may be viewed from within R by entering the following instructions at the prompt of the R console:

R> data("AntiqueFurniture") R> AntiqueFurniture
To initialize the GUI with the antique furniture data, the following instruction may be entered:

R> Biplots(Data = AntiqueFurniture[, -1], groups = AntiqueFurniture[, 1])
In other words, the data consist of all the columns of AntiqueFurniture except the first, while the group specifications are precisely the contents of the first column. As was mentioned earlier, upon initialization of the GUI, the predictive PCA biplot is shown by default. To show the CVA biplot instead, the user simply needs to click the option Joint → CVA. This option is now available since, in the call to the Biplots function, groups were specified. The predictive CVA biplot of the antique furniture data is shown in the top left panel of Figure 5. The positions of the points are determined by the first two canonical variates -those linear combinations of the original variables that maximally separate the group means, subject to certain restrictions (Krzanowski 2000, Section 11.1). The group means themselves are shown as larger but corresponding symbols (activated by clicking Additional → Interpolate → Sample group means, retaining the default options). Since there is more than one group, an optional legend is included below the biplot by default. The mechanism for the prediction of the variable values is the same as before and is illustrated in the figure in the case of sample 29.
The top right panel of Figure 5 shows the same biplot, now overlain onto a two-dimensional density estimate of the points. The density estimate is obtained by clicking Additional → Point densities and accepting the default options (amongst other things, for the point densities to be estimated for all points, as opposed to certain groups of points only). The point densities are calculated using the default arguments to the bkde2D function of the KernSmooth package (Wand and Ripley 2009). Similar biplots can be found in Blasius et al. (2009).
Sometimes it is helpful to zoom into or out of portions of a biplot. This is done by right clicking on a focal point inside the biplot, and selecting the Zoom in or Zoom out option from the pop-up menu which then appears. The bottom panel of Figure 5 shows the CVA biplot of antique furniture, enlarged around the mean of the species Ocotea bullata. The original view can be restored by choosing the Reset zoom option from the pop-up menu.
A screenshot of the GUI is shown in Figure 6. To the left, a CVA biplot of the antique furniture data appears. From the settings box, it can be seen that the axes are not predictive; in fact they are vector sum interpolative. Also, the data have not been transformed, except for the obligatory centring of the columns to have zero means. In any case, CVA biplots are unaffected by the scaling of the variables to have unit variance.
Sample 18 has been dragged from the biplot into the kraal. It has therefore not been taken into account in the construction of the biplot. However, using its original variable values-104, 387, 1 290, 381, 22 and 12, respectively-it has subsequently been interpolated onto the biplot towards the bottom of the image (using the Additional → Interpolate → A New Sample option). This is the most appropriate position for the sample in the existing biplot. It is reassuring that the positions assigned to sample 18 in Figures 5 and 6 correspond so closely. This need not have been the case. Also notice that, notwithstanding the removal of sample 18, the calibrations and directions of the predictive and interpolative biplot axes differ. This is in general the case for CVA biplots. More details are given in Appendix A.5.
The biplot in Figure 6 also sports colour-coded classification regions. These are the regions in the display space plane closest to the respective group means in a specified number of canonical dimensions, here the default number, two. The classification regions are included by selecting Classification regions from the Additional menu. They may be used for the classification of interpolated samples. For more on the links between biplots and discrimination, see . Furthermore, by clicking Additional → Alpha-bags, alpha-bags (Gardner 2001;Aldrich et al. 2004) and Tukey medians have been superimposed for the species Ocotea bullata and Ocotea porosa (there are too few samples for an alpha-bag for Ocotea kenyensis to be constructed; with an appropriate warning, a convex-hull is displayed instead). Alpha-bags are closely related to the bagplots of Rousseeuw et al. (1999) and enclose regions that contain approximately the inner 100α% of samples, here 90% of the samples for the two species separately. The alpha-bags and convex hull do not overlap. This emphasizes the high degree of separation between the species. For CVA biplots, group predictivities may also be calculated, in addition to the point and axis predictivities Figure 6: A screenshot of the GUI. A vector sum interpolative CVA biplot of the antique furniture data is shown towards the left, with sample 18 removed to the kraal. Sample 18 has then been interpolated to give its implied position. Classification regions are shown, as well as 90% alpha-bags for the species Ocotea bullata and Ocotea porosa. A convex hull surrounds the points of the species Ocotea kenyensis. The Export tab is shown top right. discussed earlier . A diagram of these is available in the Groups tab. Finally, Figure 6 also shows the Export tab. As explained previously, various objects are available for export from this tab. The objects may be displayed in the R console or be saved to the current R workspace. The list of available objects depends on what is shown in the biplot.

Fighter aircraft
Measurements of four variables on 22 types of fighter aircraft were extracted by Cook and Weisberg (1982) from a report by Stanley and Miller (1979). Following Gower and Hand (1996), we consider only the first 21 of these aircraft in the biplots below. The four variables are: specific power, proportional to power per unit weight (SPR); flight range factor (RGF); payload as a fraction of gross weight (PLF); and sustained load factor (SLF). These data can be found in the FighterAircraft data frame included in the BiplotGUI package. The GUI is initialized in the same way as it was for the country data in Section 3.2.
The left panel of Figure 7 shows a regression biplot of the fighter aircraft data with the points determined by PCO and the inter-sample dissimilarities calculated according to the  Figure 7 shows the corresponding circular non-linear biplot (obtained by clicking Axes → Circular non-linear). Here prediction is performed by completing the circle which has, as diagonal, the line stretching from the origin of the biplot to the point to be predicted. The predicted values are read off at the points at which the circle intersects the axes (Gower and Hand 1996, Section 6.3.2). If a particular axis is intersected at more than one position, the position closest to the point being predicted is used.
If an axis isn't intersected at all, no prediction can be made for the corresponding variable. For aircraft 'n', the valid points of intersection are shown in the figure as small, filled circles on the circumference of the larger circle. From the Predictions or Export tabs, the circular non-linear predictions for aircraft 'n' are 6.090, 4.54, 0.174 and 2.90, respectively (these values depend on how finely the non-linear axes are constructed; by default 20 positions are taken into account from each calibrated marker to the next). Except for the fourth variable, the non-linear predictions are very close to the actual values.
Appendix A.7 provides the steps required to perform a PCO; the formulae underlying the regression and circular non-linear biplots are laid out in Sections A.9 and A.11, respectively.

Further features
This section touches upon the customization and export of biplots and other graphs produced using the BiplotGUI package.
There are two main ways in which the graphs of the package can be customized. Basic customization can be performed using the options of the View menu, while the Format menu options can be used to alter a large number of graphical parameters. Figure 8 shows the same predictive PCA biplot of the country data that was shown in the top left panel of Figure 2. However, the biplot in Figure 8 has been modified by changing the default selections in the View menu. The Show title option places a title above the biplot; by default the title reflects the type of biplot, but it may be changed via the Format → Title option. Furthermore, the point labels have been hidden by deselecting Show point labels. Instead of showing the axis labels around the edges of the biplot as in Figure 2, the labels in Figure 8 are shown in a legend (Show axis labels in legend). The Calibrate display space axes option calibrates the two dimensions of the biplot, but this is generally undesirable in biplots of the new approach (Gower and Hand 1996, Section 2.6). The Format menu allows virtually any of the graphical parameters used internally by the package to be altered. The biplot in Figure 9 serves as an example. This biplot is the same as the biplot that appears in the left panel of Figure 5, but with some of the default graphical parameters changed. The By group option allows the graphical parameters that relate to points, sample group means, convex hulls / alpha-bags and classification regions to be set for all groups simultaneously, or for a single group at a time. Figure 10 shows the By group dialogue box for the points of the species Ocotea bullata. The parameter values shown are as they have been set for Figure 9. The Axes option similarly allows the graphical parameters that relate to axes to be set. Figure 11 shows the Axes dialogue box for the axis 'RayW', again with the parameters as they have been set for Figure 9. The graphical parameters used for dynamic variable value prediction and in the highlighting of axes can also be modified by clicking Format → Interaction, while diagnostic tab customization may be performed via the Diagnostic tabs option. The Reset all option reverts all the graphical parameters back to their default values. In all, more than 80 different graphical parameters may be set, often-times differently for different groups or axes. All these parameters are documented in detail in the package manual.
Biplots and diagnostic tab graphs can be saved in various file formats: PDF, Postscript, Metafile, BMP, PNG, JPEG (50%, 75%, 100% quality) and PicTeX. Any graph can be saved by right clicking it and navigating the Save as menu. The biplot region may also be saved  via the File → Save as menu. While the images shown onscreen are by necessity Metafile images, the images that appear in this article-besides the screenshots-were saved in PDF format. Together with Postscript, such images are of the highest quality. Copy and Print options are also available.

Future work
Being in its first release, there is much that may be improved and expanded upon. Amongst the techniques that might sensibly be incorporated into the package are: Special options for CVA biplots in the case of two groups only (Le ; Orthogonal predictive non-linear biplots (Gower and Ngouenet 2005); AOD biplots (Krzanowski 2004;; The adjustments to the regression and Procrustes biplots suggested by Gower et al. (1999) to better suit non-metric MDS representations; Sensitivity analysis for PCO-based biplots (Krzanowski 2006); Support for categorical variables in the form of generalized biplots (Gower 1992); A better approach to the calculation of classification regions (Gower 1993).
Other improvements may also be made. These include: Allowing any pair of principal components, canonical variates or principal coordinates to be shown, as opposed to only the first two; Supporting a greater number of dissimilarity metrics; Allowing interactive orthogonal parallel translation so that axes can be moved towards the edges of biplots (Blasius et al. 2009); Incorporating a graded legend for point density estimates; Improving the three-dimensional biplots (providing support for additional descriptors, allowing dynamic variable value prediction); Otherwise improving the GUI and general performance.
As for any such package, suggestions and bug-reports by users are important and greatly encouraged.

Summary
In this paper, the BiplotGUI package for R was introduced. Its features were illustrated using three data sets. Ideas for future releases were briefly explored, and computational details were provided in an appendix.
The package makes it possible to easily construct many types of biplots and to interact with them in various ways. The package is free and its source code shared. Amongst linear biplots, the PCA, covariance/correlation, CVA, regression and Procrustes biplots are supported. Circular non-linear biplots can be created. In addition, PCO and MDS representations can be displayed on their own, without added biplot axes. Additional descriptors can be superimposed, and three-dimensional biplots can be explored using the rgl package. Various goodness-of-fit measures are easily accessible. Yan W, Kang MS (2006). GGEbiplot, Version 5. URL http://www.ggebiplot.com/.

A. Computational details
This section outlines the main formulae used to produce the biplots of the BiplotGUI package. Fuller explanations and derivations may be found in the cited works.

A.1. General
Let X : n × p represent a data matrix. The n samples of X are to be represented as points in a biplot; the p (numerical) variables are to be represented as calibrated biplot axes. Biplots are displayed in r dimensions. Typically r is taken to be 2 or 3. Biplots with higher values of r are abstractions that cannot be drawn.

A.2. Data transformations
The data matrix X is first transformed into a matrix X : n × p on which further calculations are performed. By convention, however, biplot axes are always calibrated in terms of the original variable values, those of X. Six transformations are supported: 'centre', 'centre, scale', 'unitize, centre', 'log, centre', 'log, centre, scale' and 'log, unitize, centre

A.3. The PCA biplot
Points: The normalized eigenvectors corresponding to the r largest eigenvalues of X X form the columns of a basis matrix V r : p × r. The samples of X are represented as points in the display space at coordinates Y : n × r = XV r . These are simply the 'scores' of the first r principal components.
Axes: All biplot axes pass through the origin. Predictive and interpolative biplot axes coincide in direction.
The jth predictive biplot axis is calibrated µ at coordinates ( µe j V r )/(e j V r V r e j ), with µ the consistently transformed µ, and with e j the jth column of the identity matrix I p . Convenient markers, representative of the jth column of X, are variously substituted into µ to calibrate the entire axis. The jth vector sum interpolative biplot axis is similarly calibrated µ at coordinates µe j V r , while the jth centroid interpolative biplot axis is calibrated µ at coordinates µpe j V r .
Goodness-of-fit: With λ j the jth largest eigenvalue of X X, the quality of the representation is given by ( r j=1 λ j )/( p j=1 λ j ). The adequacy of the jth biplot axis is e j V r V r e j . The r-dimensional point predictivities are given by the diagonal elements of diag( X X )diag( X X ) −1 , with X the reconstructed matrix X = XV r V r . The r-dimensional axis predictivities are given by the diagonal elements of diag( X X)diag( X X) −1 .
Quality, adequacies and predictivities always lie in the interval [0, 1], with higher values better.
More: Full details may be found in Gower and Hand (1996, Chapter 2), and, for point and axis predictivities, in Gardner-Lubbe et al. (2008).

A.4. The covariance/correlation biplot
When X is transformed into X by centring only, the biplot is known as a covariance biplot. If in addition X is transformed by scaling, the biplot is known as a correlation biplot.

Points:
The basis matrix for interpolation is given by V r,int = (n − 1) 1/2 V r,pca diag(λ 1 , . . . , λ r ) −1/2 , where λ 1 , . . . , λ r are the r largest eigenvalues of X X and where the columns of V r,pca contain the corresponding normalized eigenvectors. In the case of both interpolative and predictive biplots, the samples are represented as points in the display space at coordinates Y = XV r,int .
The jth predictive biplot axis is calibrated µ at coordinates ( µe j V r,pr )/(e j V r,pr V r,pr e j ). The jth vector sum interpolative biplot axis is calibrated µ at coordinates µe j V r,int , while the jth centroid interpolative biplot axis is calibrated µ at coordinates µpe j V r,int .

A.5. The CVA biplot
Points: In CVA biplots, the n samples are grouped. With g groups of size n 1 , . . . , n g , respectively, the matrix of group sizes is given by N = diag(n 1 , . . . , n g ). The matrix of sample group means,¯ X : g × p, is calculated from the transformed data matrix X. The between groups sums-of-squares-and-crossproducts matrix is given by while the within groups sums-of-squares-and-crossproducts matrix is given by The normalized eigenvectors corresponding to the non-increasing eigenvalues of the matrix W −1/2 BW −1/2 are placed into the columns of a matrix V temp . Then with V = W −1/2 V temp , the basis matrix for interpolation, V r,int , consists of the first r columns of V. In the case of both interpolative and predictive biplots, the samples are represented as points in the display space at coordinates Y = XV r,int . These are simply the 'scores' of the first r canonical variates.
Axes: All biplot axes pass through the origin. Predictive and interpolative biplot axes do not in general coincide in direction. The basis matrix for prediction, V r,pr , consists of the first r columns of (V −1 ) . The jth predictive biplot axis is calibrated µ at coordinates ( µe j V r,pr )/(e j V r,pr V r,pr e j ). The jth vector sum interpolative biplot axis is calibrated µ at coordinates µe j V r,int , while the jth centroid interpolative biplot axis is calibrated µ at coordinates µpe j V r,int .
Goodness-of-fit: The r-dimensional point predictivities are given by the diagonal elements of where Y g = (I − G(G G) −1 G ) X and G is the sample-group indicator matrix which has ith row e k if sample i belongs to group k, i = 1, . . . , n, k = 1, . . . , g. The matrix Y g is given by Y g = Y g V r,int (V r,pr ) . The r-dimensional group predictivities are given by the diagonal elements of with X the reconstructed matrix X = XV r,int (V r,pr ) . The r-dimensional axis predictivities are given by the diagonal elements of diag(ˆ X Nˆ X){diag( X N X)} −1 .
More: Full details may be found in Gower and Hand (1996, Chapter 5), and, in the case of point, group and axis predictivities, in Gardner-Lubbe et al. (2008).

A.6. Dissimilarity metrics
One of four dissimilarity metrics can be used to calculate an inter-sample dissimilarity matrix D : n × n from the transformed data matrix X. Under the Pythagoras dissimilarity metric, with S e X the sample covariance matrix of X. Note that the term 'Pythagoras' is used instead of 'Euclidean' in order to avoid confusion with the term 'Euclidean-embeddable' of the next section.

A.7. PCO
Points: An inter-sample dissimilarity matrix D is calculated from X according to one of the four dissimilarity metrics of Appendix A.6. All four dissimilarity metrics are Euclideanembeddable (Gower 1982), as required by PCO. The sums-of-squares-and-crossproducts matrix is given by B = (I − 1 n 1 n 1 n )D(I − 1 n 1 n 1 n ).
The r largest eigenvalues of B, λ 1 , . . . , λ r , are taken to form the diagonal elements of matrix Λ : r × r. The corresponding normalized eigenvectors are placed into the columns of matrix V r : n × r. The samples are then represented as points in the display space at principal coordinates Y = V r Λ 1/2 . PCO is also known as 'classical scaling'.
Goodness-of-fit: The quality of the representation is given by ( r j=1 λj)/( p j=1 λ j ). A Shepard diagram may also be drawn.
More: Full details may be found in Gower and Hand (1996, Section A.5.2) and Cox and Cox (2001, Section 2.2). The Shepard diagram is described by Borg and Groenen (2005, Section 3.3).

A.8. MDS
Points: An inter-sample dissimilarity matrix D is calculated from X according to one of the four dissimilarity metrics of Appendix A.6. The samples are represented in the display space at coordinates Y : n × r, with Y found algorithmically to minimize the stress criterion In this expression,d ii represents the inter-sample disparity between sample i and i . Intersample disparities are derived from the inter-sample dissimilarities D by one of three transformations: the identity transformation, monotone regression, or a monotone spline transformation. The quantity δ ii (Y), in turn, represents the Pythagorean distance between rows i and i of Y, called the inter-point distance. An IM algorithm is used to find the minimising matrix Y. The algorithm converges uniformly to a local minimum, although in theory a saddle-point cannot be ruled out. In practice, the algorithm is taken to have converged as soon as the relative decrease in stress becomes smaller than some pre-set value. The algorithm is also stopped as soon as a certain maximum number of iterations has been performed.
Goodness-of-fit: A Shepard diagram may be drawn.
More: For more details and a full description of the implementation of the IM algorithm, see Borg and Groenen (2005, Chapters 8, 9). The Shepard diagram is described by Borg and Groenen (2005, Section 3.3).

A.9. The regression biplot
Points: The samples are represented as points with coordinates Y : n × r. The coordinates are typically determined by PCO or MDS, but any scaling method can be used.

Axes:
The basis matrix is given by V r = (Y Y) −1 Y X. All other details are the same as for the axes of the PCA biplot.
More: Full details may be found in Gower and Hand (1996, Sections 3.3.2, 3.4.3).

A.10. The Procrustes biplot
Points: The samples are represented as points with coordinates Y : n × r. The coordinates are typically determined by PCO or MDS, but any scaling method can be used. When the points are determined by PCO based on Pythagorean dissimilarities, the PCA, regression and Procrustes biplots coincide.
Axes: All biplot axes pass through the origin. Predictive and interpolative biplot axes do not in general coincide in direction. By the method of orthogonal Procrustes analysis, the basis matrix for prediction, V r,pr , is given by the first r columns of BA , where X Y = AΣB is the singular value decomposition of X Y. The jth predictive biplot axis is calibrated µ at coordinates ( µe j V r,pr )/(e j V r,pr V r,pr e j ). The basis matrix for interpolation, V r,int , minimizes Y − XV out of all projection matrices V with orthonormal columns. The solution is found by minimal error projection Procrustes. The jth vector sum interpolative biplot axis is calibrated µ at coordinates µe j V r,int , while the jth centroid interpolative biplot axis is calibrated µ at coordinates µpe j V r,int .
More: Full details may be found in Gower and Hand (1996, Sections 3.3.1, 3.4.2). For more on orthogonal Procrustes analysis, see Gower and Hand (1996, Appendix A.10.1). The algorithm for minimal error projection Procrustes is described in Gower and Dijksterhuis (2004, p. 57). See also Gower and Hand (1996, Appendix A.10.2) and Cox and Cox (2001, Section 5.2

.2).
A.11. The circular non-linear biplot Points: The samples are represented as points with coordinates Y : n × r determined by PCO. The dissimilarity metric is assumed to be additive (Gower and Hand 1996, p. 105), as all the dissimilarity metrics of Appendix A.6 are besides Mahalanobis. Matrices B and Λ are carried forward from PCO. Define [E] ii = − 1 2 [D] 2 ii , with D the dissimilarity matrix. Axes: The biplot axes can be chosen to pass through a common point. Predictive and interpolative biplot axes do not in general coincide. To find the position of marker µ on the jth vector sum interpolative biplot axis, the vector d n+1 : n × 1 is taken to contain the dissimilarities, divided by −2, between µe j and the n samples of X. The axis is calibrated µ at the first r coordinates of y = Λ −1 Y (d n+1 − 1 n E1). The jth centroid interpolative biplot axis is calibrated µ at the first r coordinates of y = pΛ −1 Y (d n+1 − 1 n E1). The construction of predictive non-linear biplot axes is more complicated and is described in Gower and Hand (1996, Section 6.3.2).
More: Full details may be found in Gower and Hand (1996, Chapter 6). See also Gower and Harding (1988) and Gower and Ngouenet (2005).

B. Setup
R can be downloaded from CRAN at http://CRAN.R-project.org/ for any of the three major platforms: Linux, MacOS X and Windows. At the time of writing, the latest version of R is 2.9.0. At present, BiplotGUI is intended to be run under Windows. Future releases will be more general.
The BiplotGUI package and its dependencies can most easily be downloaded and installed into R by issuing the following command in the R console: