diffplot {canprot}R Documentation

Plot Compositional Differences


Make a plot showing differences and p-values.


  diffplot(comptab, vars = c("ZC", "nH2O"), col = "black",
           plot.rect = FALSE, plot.text = TRUE)



list or data frame, summary of comparisons generated by ZC_nH2O


character, which variables to plot


the color(s) for points


plot a reference rectangle?


add text labels to the points?


A plot is created with points showing the differences in means of two compositional metrics. The default setting of vars refers to average oxidation state of carbon (ZC) as the x-variable and water demand per residue in formation reactions from basis species (n̄H2O) as the y-variable.

For each dataset, the point symbol is a filled square if the p-values of both the x-variable and y-variable are less than 0.05, a filled circle if the p-value of one of the x- or y-variables is less than 0.05, and an open circle otherwise.

A solid line is drawn from the point to the corresponding axis if the rounded, absolute value of (CLES in percent - 50) of the x- or y-variable is greater than or equal 10. Otherwise, a dashed line is drawn from the point to the corresponding axis if the p-value of the x- or y-variable is less than 0.05. Otherwise, no line is drawn.

The colors of the points are controlled by col, which is recycled to be equal to the number of comparisons in comptab.

If plot.rect is TRUE, a shaded rectangle is drawn with coordinates -0.01, -0.01, 0.01, 0.01. This is useful for emphasizing the different scales of adjacent plots.

If plot.text is TRUE, the points are plotted in a bigger size and text labels are added. The labels are taken sequentially from 26 lowercase Roman letters in alphabetical order (letters), followed by the set of uppercase letters (LETTERS).


comptab <- lapply(c("JKMF10", "WDO+15_C.N"), function(dataset) {
  pdat <- get_pdat(dataset)
  ZC_nH2O(pdat, plot.it=FALSE)

[Package canprot version 0.1.0 Index]