Friday, 19 June 2020

Known GCDkit 6.0 installation problems and how to solve them

We have been  receiving reports recently of failed installations on both Mac and Windows. If you have the same problem, please:

  • Check once more all the instructions at
  • In particular, make sure that you install R first, in appropriate version (that is 3.6.0 for GCDkit  6.0)
  • If you are behind a proxy, select Internet2  option during Custom R installation
  • Check that you are online before installing the supporting libraries
On Windows:
  • For installation, run R with admin privileges
  • If you receive a message saying that RODBC is not available for R 3.6.0:
    [1] Download the zipped version of the RODBC library from
    [2] Go to RGUI menu Packages>Install package(s) from local zip files... and browse for this downloaded file on your disc. DO NOT unzip it beforehand. 
  • In case you are missing any other R libraries, their appropriate zipped version can be found at, downloaded and installed analogously to the case of RODBC.
We do apologise for the inconvenience - the fact that  RODBC library is not correctly configured on the CRAN server is unfortunately beyond our control.

I am pleased to announce that we are just finishing a GCDkit version 6.1 that should fix a few known bugs and feature, among other things, also offline installer.


Thursday, 22 August 2019

GCDkit 6.0 has been unleashed. What is new?

On August 16, 2019 has been released a new version of GCDkit 6.0. It was developed in R 3.6.0 and code-named Il padrino sono io. This is the first truly platform independent version that could run on all systems, including Mac OS X and Linux from both command line and graphical user interface (GUI). The most important changes are summarised below.

Platform-independent GUI
  • Optional platform-independent Tcl/Tk graphical user interface (GUI)
  • In both command-line/batch mode and from graphical user interface (GUI), the GCDkit should run also operation systems other than Windows, notably Linux or Mac OSX. To start GUI on non-Windows systems, type menuet()

Performance improvements
  • Quicker response of the menu for geotectonic plots that is newly being built only once, upon the system startup 
  • Quicker and improved routine enabling overplotting datasets, especially values after Debon and Le Fort.
  • Some norms (most notably CIPW) were speeded up considerably.

User-defined plots

  •  Help pages to user-defined plots are added automatically to the html help system.
Bug fixes
  • Correct function on the Chinese (and perhaps other non-European) locales.
New plugins
  • New plugin for ternary projection from biotite (Moyen et al. 2017).
New geotectonic/general purpose diagrams
  • B vs. Mg/(Fe + Mg), Q vs. B, K/(Na+K) vs. B and BQF ternary diagram of Debon and Le Fort (1983, 1988) 
  • Diagrams for classification of feldspathic igneous rocks of Frost and Frost (2008)
  • Diagram of Laurent et al. (2014) to decipher possible source of granitic magmas
  • New function phasePropPlot() that plots barplot of mineral proportions
  • Mesonormative Q'-ANOR diagram of Streckeisen and Le Maitre (1976) was added to the Classification plots and can be indeed used for this purpose now. If necessary, a matrix of mesonormative values can be provided upon call; otherwise these are to be calculated anew. 

The new version of GCDkit has been unveiled at the Goldschmidt Conference in Barcelona on 21 August. Follow this link for the PDF version of the poster. 

Sunday, 3 March 2019

GCDkit not starting on Chinese locales?

Several users from China have reported problems with running GCDkit 5.0.

The troublemaker is the newly introduced Eartchem module, as already mentioned here: 

The problem is clearly with multibyte encoding of Chinese characters. But the bug may be also affecting the users on other locales/systems, including Mac.

The fix is relatively simple, though. Please, in the line 216 of the EarthChemFUN.r file, replace the text by:

if(.Platform$OS.type=="windows") zzz[zzz==intToUtf8(0x00c2)]<-NA

and restart GCDkit.

Please accept my apologies. The next version of GCDkit (6.0), now at the stage of beta testing, will have this problem solved.


Special thanks go to Jiacheng Tian and Shi-Chao Li for their helpful bug reports and patience.

Plotting TAS diagram of Le Bas et al. (1986)

By far the most common bug report that we are getting concerns the implementation of the total alkali-silica (TAS) diagram of Le Bas et al. (1986) in GCDkit. But in reality, it is  not a bug, but a feature. One should be aware of the fact that the analyses plotted have been recalculated on 100% anhydrous (volatile-free) basis.  This is in accordance with the recommendation of the IUGS  Subcommission on the Systematics of Igneous Rocks (Le Bas et al. 1986; Le Maitre ed. 2002).

On the other hand, such a recalculation is not carried out for subsequent modifications of the TAS diagram (Cox et al. 2002; Middlemost 1994), where rough data are plotted.

In any case, using analyses with too high volatile contents is to be avoided, as they are suspicious from being affected by alteration and attendant mobility of alkalis.   

Cox KG, Bell JD & Pankhurst (1979) The Interpretation of Igneous Rocks.
Allen & Unwin, London

Le Bas MJ, Le Maitre RW, Streckeisen A & Zanettin B (1986)
A chemical classification of volcanic rocks based on the total alkali-silica
diagram. J Petrology 27: 745-750

Le Maitre RW (ed) (2002) Igneous rocks: a classification and glossary of terms: recommendations
of the International Union of Geological Sciences, Subcommission on the Systematics of
Igneous Rocks, 2nd edition. Cambridge University Press

Middlemost EAK (1994) Naming materials in the magma/igneous rock system.
Earth Sci Rev 37: 215-224

Wednesday, 18 April 2018

How to use GCDkit in a batch mode II

In one of the earlier blogs, Jeff has presented my exercise showing effective use of batch mode borrowed from our joint workshop at University of Catania.  

Here I would like to carry on and show the new capabilities of GCDkit to use multiple datasets and to overplot them on a single diagram (or plate thereof).

Binary plot

# Loading and storing the 1st dataset

Loading and storing the 2nd dataset

Switching back to the atacazo dataset
# Overplotting classification diagram


# Overplotting on spiderplot

# Atacazo as grey field

A plate (Harker plots)

# blatna dataset
plateXLim(c(53,70)) # Common x axis scaling
plate0YLim() # All y axes start from 0


# Overplot sazava on top of it

# Getting rid of the datasets other than the current (blatna)

User-defined diagrams in GCDkit 5.0

Due to a popular demand, the new version of our program comes with a straightforward possibility of adding (Figaro-compatible) templates for both stand-alone binary/ternary diagrams and plates. If done correctly, they integrate seamlessly into the GCDkit system, namely into the menu 'Plots|User defined...' .

There are still some limitations, though. So far, the user-defined diagrams cannot be used for classification purposes (and hence for defining subsets, groups…).  We cannot offer language versions other than English, either.


All *.r or *.R files stored in the directory Diagrams/User , except for those whose name starts with underscore ("_"), are sourced every time the menu item 'Plots|User defined...' is invoked. Hence the list of available diagrams is always built on fly, using the function .userlist().

The ordering information and name under which it appears in the menu are integral parts of the template. For stand-alone, single Figaro plots, the crucial information is:
  • Name of function defining a diagram
  • Name of the plot: sheet$demo$template$GCDkit$
  • Sequence number of the plot in the menu: sheet$demo$template$GCDkit$plot.position

For a plate of Figaro templates:
  • Name of function defining a plate
  • Name of the whole plate: plate$
  • Sequence number of the plot in the menu: plate$plot.position 

In both cases, the file should define a single function of a name identical to (the root of) the filename.
 'Sequence number' above is any positive real number (i.e., it does not have to be an integer).


The HTML documentation is linked to the help system automatically. However, this is only done when the *.htm file, named exactly like the function, resides in Diagrams/User/doc subdirectory.

An example

Here is an example of the Al2O3/SiO2 vs MgO/SiO2 binary plot of Paulick et al. (2006). This is done using the function Paulick provided in the file Paulick.r  of  the current GCDkit distribution.

#                  Al2O3/SiO2 vs MgO/SiO2 binary plot               #
#                   Fig. 3 in Paulick et al. (2006)                 #
#  Paulick, H., Bach, W., Godard, M., De Hoog, J.C.M., Suhr, G.,    #
#  Harvey, J., 2006. Geochemistry of abyssal peridotites (Mid-      #
#  Atlantic Ridge, 15o20'N, ODP Leg 209): implications for fluid/   #
#  rock interaction in slow spreading environments. Chemical Geo-   #
#  logy, 234: 179-210.                                              #

col="darkgray", lwd=10),
plot.position=12,"Al2O3/SiO2 - MgO/SiO2 (Paulick et al. 2006)"

text="Terrestrial Array\n(melting trend)",

if(getOption("gcd.plot.text")) temp<-c(temp,temp2) # Text on?

main=annotate("Al2O3/SiO2 - MgO/SiO2 plot
  (Paulick et al. 2006)"

Saturday, 14 April 2018

Version 5.0 has been just released!

On March 28, 2018 has been released a new version of GCDkit 5.0. It was developed in R 3.4.3 and code-named El Chupacabra. The most important changes are summarised below.

Towards a platform-independent version
  • It is well-known that the GCDkit has been originally designed as a Windows-only package. From the current version it is possible to install  and run it also on operation systems other than Windows,  most notably Linux or Mac OSX.  
  • So far, this concerns command-line/batch mode only. 
  • The platform-independent graphical user interface (menus, dialogue boxes...) written in Tcl/Tk language  is ready and just being tested. If you are feeling unadventurous, and work on Linux and/or Mac, please do get in touch and you can become one of the beta testers. 

New Windows installer
  • As we hope, we have fixed the long-standing problems with the installation of GCDkit on Windows 10, and people without administrative rights.
  • The new GUI installer, based on the Tcl/Tk  language,  is started by simply dragging the file @INSTALL.r from the temporary installation directory onto the R Console window. 
  • his file can be also located manually and loaded using the  File|Source R code...'  menu. See the download page for more details. 
  • Please note that this installer relies on a live Internet connection to download the missing packages required by the GCDkit. 

User-defined templates
  • User-defined templates for stand-alone Figaro plots or their plates. They can be uploaded into the  directory Diagrams/User and then employed for standard plotting (i.e. not classification)  purposes. This mechanism allows easy and fully automatic expansion of the plotting capabilities  of the GCDkit system. For further info, see the file @README.txt in the directory in question.
  • There are five examples of user-defined templates provided: three binary plots for discrimination of lavas from destructive plate boundaries (Pearce 1982), ternary plot for classification of A-type granites (Grebennikov 2014) and binary plot of Paulick et al. (2006) to portray the mantle peridotite fertility.  

Overplotting two or more datasets on a single diagram (or plate)
  • Functions allowing overplotting new datapoints onto standard single binary plots, ternary plots,
    spiderplots or multiple plots, including the diagram templates (overplotDataset, underplotDataset) linked to the menu system. 
  • In addition, there are functions figOverplot and figOverplotDiagram but these are meant mostly for internal use. 
  • For plotting serves a reference dataset, either real-world data (say compiled from literature) or a numeric  matrix spanning, for instance, from petrogenetic modelling.
  • See the example of overplotting the atacazo over sazava dataset on De la Roche et al. (1980) plot.
  • Very attractive feature should be the new possibility of obtaining dataset by online search of the database. The search can be performed directly from the menu GCDkit|Online search  It invokes a graphical front-end, written By Oscar Laurent (ETH, Zurich) that allows to enter the desired search criteria. On Windows, it also includes a primitive, and still rather slow, possibility of selecting a polygon of interest from a map of the World. 

Further new features/important changes
  • New plugin 'disclosure' for log-transformation of compositional data.
  • New geotectonic/general purpose diagrams
    • La/Yb vs. Nb/La and La/Yb vs. Th/Nb of Hollocher et al. (2012)
    • La/10-Y/15-Nb/8 of Cabanis and Lecolle (1989)
    • Zr/Y-Th/Yb of Ross and Bedard (2009)
    • YbN vs. LaN/YbN of Martin (1986) to distinguish adakites and TTGs
    • F-M-W diagram (Ohta and Arai 2007) for chemical weathering of igneous rocks
  • calcAnomaly, a function for calculating a magnitude of any anomaly on any spiderplot, based on concentrations of selected neighbouring (not necessarily adjacent) elements.
  • Spanish translation of the classification plots (courtesy of Tomas Grijalva,  Geology Department of UNAM, Mexico).
  • New zircon saturation model of Boehnke et al. (2013).
  • New training dataset giving the whole-rock major- and trace-element contents,   together with Sr and Nd isotopic compositions of lavas from two volcanic complexes in Ecuador: the Atacazo and the Ninahuilca (Hidalgo 2006; Hidalgo et al. 2008).   This dataset, kindly provided by Silvana Hidalgo, is used in a worked example (chapter 25) of Janousek et al.’s book (2016).
  • Another new training dataset from the Central Bohemian Plutonic Complex, Czech Republic  (Janousek et al. 2000, 2010). It could be, together with already present, used to test dataset switching etc.
  • New function figFixLim() extends the scales of both axes of a binary plot automatically  if necessary to accommodate all the data points.
  • new training dataset from the Central Bohemian Plutonic Complex, Czech Republic (Janousek et al. 2000, 2010). It could be, together with already present, used to test   dataset switching etc.
  •  New function figFixLim()extends the scales of both axes of a binary plot automatically  if necessary to accommodate all the data points.
  • New normalization scheme of Anders and Grevesse (1989) for chondrite-normalized REE spiderplots.
  • Better behaviour of many functions in batch mode (in RTerm, Jupyter, on Linux/Mac etc.)......

  • We trust that you will find this new release useful and reasonably stable.

    Good luck, Vojtech