cart: tectonic discrimination by decision tree

View source: R/tree.R

cartR Documentation

tectonic discrimination by decision tree

Description

Classification And Regression Trees (CART) of basalts from ocean islands (OIB), mid-oceanic ridges (MORB) and island arcs (IAB).

Usage

cart(
  dat,
  option = 1,
  type = c("class", "prob", "vector", "matrix"),
  plot = FALSE,
  ...
)

Arguments

dat

a data frame or matrix with the following columns (missing data are allowed):

If option=1: SiO2 (as wt%) or Si (as ppm), TiO2 (as wt%) or Ti (as ppm), CaO (as wt%) or Ca (as ppm), Fe2O3 (as wt%) or Fe3 (as ppm), MgO (as wt%) or Mg (as ppm), K2O (as wt%) or K as ppm, La, Pr, Nd, Sm, Gd, Tb, Yb, Lu, V, Ni, Rb, Sr, Y, Hf, Th (all as ppm), Sr87/Sr86 and Pb206/Pb204.

If option=2: TiO2 (as wt%) or Ti (as ppm), La, Ce, Pr, Nd, Sm, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu, Sc, Y, Zr, Nb, Hf, Ta, Pb, Th, U (all as ppm), Nd143/Nd144, Sr87/Sr86, Pb206/Pb204, Pb207/Pb204 and Pb208/Pb204.

If option=3: TiO2 (as wt%) or Ti (as ppm), La, Sm, Nd, Gd, Yb, Sc, V, Sr, Y, Zr, Nb, Th, U (all as ppm).

option

numerical. If option=1, uses all major and trace element concentrations and isotopic ratios, if option=2, uses high field strength element concentrations and isotopic ratios, if option=3, uses high field strength element ratios.

type

character string denoting the type of predicted value returned.

plot

logical. If TRUE, produces a dendrogram with the leaves marking the number of classified samples.

...

optional arguments to text.rpart, except for xpd and use.n, which have been set to NA and TRUE, respectively and cannot be changed.

Value

If type="class": a factor of classifications based on the responses.

If type="prob": a matrix of class probabilities.

If type="vector": vector of predicted responses.

If type="matrix": a matrix of the full responses, i.e. the concatenation of at least the predicted class, the class counts at that node in the fitted tree, and the class probabilities.

Examples

data(test,package='GeoplotR')
tree <- cart(test,option=1,plot=TRUE)

pvermees/GeoplotR documentation built on Aug. 20, 2024, 4:45 a.m.