R documentation ‘Saturnin’ March 26, 2006 R topics documented: acnk . . . . . . ap.saturation . . filter.out . . . . load.file . . . . millicat . . . . mz.saturation . normalize2total r2clip . . . . . zr.saturation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 4 4 5 6 7 7 8 10 A/CNK values (Shand 1943) acnk Description Calculates alumina saturation index (A/CNK) of Shand (1943) Usage acnk(what) Arguments what . . . . . . . . . numeric matrix with millications. Details Classic Shand’s (1943) values termed alumina saturation index. Value A vector with the results. 1 2 ap.saturation Author(s) Vojtech Janousek, [email protected] References Shand (1943) Eruptive Rocks. John Wiley & Sons See Also millicat Apatite saturation ap.saturation Description Calculates apatite saturation temperatures for observed whole-rock major-element compositions. Prints also phosphorus saturation levels for the given major- element compositions and assumed magma temperature. Usage ap.saturation(Si=WR[,"SiO2"],ACNK=WR[,"A/CNK"], P2O5=data.matrix(WR)[,""P2O5""],T=750) Arguments Si SiO2 contents in the melt (wt. %) ACNK vector with A/CNK (mol %) values P2O5 vector with P2 O5 concentrations T assumed magma temperature in C Details * Calculates phosphorus saturation levels following Harrison & Watson (1984): ln(DP ) = 8400 + 26400(SiO2 − 0.5) − 3.1 − 12.4(SiO2 − 0.5) T P2 O5 .HW = 42 DP where ’T’ = absolute temperature (K), ’DP ’ = distribution coefficient for phosphorus between apatite and melt and ’SiO2 ’ is the weight fraction of silica in the melt, SiO2 wt. %/100. These formulae were shown to be valid only for metaluminous rocks, i.e. A/CNK < 1, and were modified for peraluminous rocks (A/CNK > 1) by Bea et al. (1992): P2 O5 .Bea = P2 O5 .HW e 6429(A/CN K−1) (T −273.15) 3 ap.saturation and Pichavant et al. (1992): P2 O5 .P V = P2 O5 .HW + (A/CN K − 1)e −5900 −3.22SiO2 +9.31 T Note that the phosphorus saturation concentrations are not returned by the function but printed only. * Calculates saturation temperatures in C using the observed P2 O5 concentrations (Harrison & Watson, 1984): T.HW = 8400 + 26400(SiO2 − 0.5) − 273.15 ln( P242O5 ) + 3.1 + 12.4(SiO2 − 0.5) for peraluminous rocks (A/CNK > 1) the equation of Bea et al. (1992) needs to be solved for ’T’ (in K) by iterations: 42 P2 O5 .Bea = e 8400+26400(SiO2 −0.5) −3.1−12.4(SiO2 −0.5) T e 6429(A/CN K−1) (T −273.15) as is that of Pichavant et al. (1992): 42 P2 O5 .P V = e 8400+26400(SiO2 −0.5) −3.1−12.4(SiO2 −0.5) T + (A/CN K − 1)e −5900 −3.22SiO2 +9.31 T Value Returns a matrix ’results’ with the following columns: A/CNK A/CNK values Tap.sat.C.H+W saturation T of Harrison & Watson (1984) in C Tap.sat.C.Bea saturation T of Bea et al. (1992) in C, peraluminous rocks only Tap.sat.C.Pich saturation T of Pichavant et al. (1992) in C, peraluminous rocks only Author(s) Vojtech Janousek, [email protected] References Bea F, Fershtater G B & Corretgé L G (1992) The geochemistry of phosphorus in granite rocks and the effects of aluminium. Lithos 29: 43-56 Harrison T M & Watson E B (1984) The behavior of apatite during crustal anatexis: equilibrium and kinetic considerations. Geochim Cosmochim Acta 48: 1467-1477 Pichavant M, Montel J M & Richard L R (1992) Apatite solubility in peraluminous liquids: experimental data and extension of the Harrison-Watson model. Geochim Cosmochim Acta 56: 38553861 4 load.file filter.out Extracting specified columns of a data frame/matrix Description This function returns samples for which are available the specified data columns in a matrix/data frame. Usage filter.out(where, what) Arguments where name of the matrix/data frame what character vector with names of the columns to be extracted Details Returns columns ’what’ for samples from ’where’, for which all the values are greater than zero. Value Matrix with the extracted elements. Author(s) Vojtech Janousek, [email protected] Examples filter.out(WR,c("SiO2","Al2O3","FeO")) load.file Loading a data file Description Loads data stored in a tab-delimited ASCII text file. Usage load.file() 5 millicat Details In the text file, the first line contains names for the variables/data columns (except for the first one that is automatically assumed to contain the sample names). Hence the first line must have one item less than the following ones. The data rows start with sample name and do not have to be all of the same length (the rest of the row is filled by ’NA’ automatically). Missing values (’NA’) are allowed anywhere in the data file (naturally apart from sample and column names). The data files can be practically freeform, i.e. no specified oxides/elements are required and no exact order of these is to be adhered to. Extra columns not required by the calculation algorithms are ignored. Analyses can contain as many numeric columns as necessary, the names of oxides and trace elements are self-explanatory (e.g. ’SiO2’, ’Fe2O3’, ’Rb’, ’Nd’). Note that names of variables are case sensitive in R and that each of the sample and variable names need to be unique. Value Data frame with the loaded data Author(s) Vojtech Janousek, [email protected] Millications millicat Description Returns millications. Usage millicat(what=WR) Arguments what numeric matrix with the whole-rock data Details The calculated values are Si, Ti, Al, Fe3, Fe2, Fe, Mn, Mg, Ca, Na, K, P, Li. Elementi = 1000 Oxidei (wt.%) ∗ x(Elementi ) M W (Oxidei ) Where: MW = molecular weight of the Oxide[i], x = number of atoms of Element[i] in the formula Value Numeric matrix with the millications Author(s) Vojtech Janousek, [email protected] 6 mz.saturation mz.saturation Monazite saturation (Montel 1993) Description Calculates monazite saturation temperatures for given major-element compositions and LREE contents of the magma. Usage mz.saturation(cats = millicat(WR), H2O = 3, Xmz = 0,83) Arguments cats numeric matrix; whole-rock data recast to millications H2O assumed water contents of the magma Xmz mole fractions of the REE-phosphates in monazite Details This function uses saturation model of Montel (1993). The formulae are as follows: P LREE = REEi ( at.weight(REEi) ) Xmz where REEi : La, Ce, Pr, Nd, Sm, Gd. Dmz = 100 T mz.sat.C = N a + K + Li + 2Ca 1 . Al Al + Si 13318 √ − 273.15 9.5 + 2.34Dmz + 0.3879 H2 O − ln(LREE) Value Returns a matrix ’results’ with the following columns: Dmz distribution coefficient Tmz.sat.C monazite saturation temperature Author(s) Vojtech Janousek, [email protected] References Montel J M (1993) A model for monazite/melt equilibrium and application to the generation of granitic magmas. Chem Geol 110: 127-146 7 normalize2total normalize2total Recast to given sum Description Recasts the selected data to a fixed sum. Usage normalize2total(what, total = 100) Arguments what numeric matrix. total a sum the data should be normalized to. Details The function returns the selected elements/oxides (columns in the data matrix ’WR’) normalized to the required sum. Value Numeric vector/matrix with the results. Author(s) Vojtech Janousek, [email protected] Examples normalize2total(major,1) r2clip Copy results to clipboard Description Copies the specified variable (typically the most recently calculated results) to a clipboard. Usage r2clip(what=results) Arguments what Value None. a variable to be copied, can be either a vector, a matrix or a data frame. 8 zr.saturation Author(s) Vojtech Janousek, [email protected] zr.saturation Zircon saturation (Watson + Harrison 1983) Description Calculates zircon saturation temperatures for the observed major-element data and Zr concentrations. Returns also Zr saturation levels for the given major-element compositions and assumed magma temperature. Usage zr.saturation(cats = millicat(WR), T = 750, Zr = subset(WR, Zr>0, "Zr")) Arguments cats numeric matrix; whole-rock data recast to millications T assumed temperature of the magma in C Zr numeric vector with Zr concentrations Details Calculates Zr saturation concentration at the specified temperature. Given ’T’ is the estimated absolute temperature (K) of the magma and ’M’ is a cationic ratio: M = 100 N a + K + 2Ca Al.Si it can be written Watson & Harrison 1983): DZr = e(−3.8−0.85(M −1)+ 12900 ) T The Zr saturation level is then given by: Zr.sat = 497644 DZr On the other hand, the saturation temperature can be obtained from the observed Zr concentration and magma composition (assuming no zircon inheritance) DZr = T Zr.sat.C = 497644 Zr 12900 − 273.15 ln(DZr ) + 3.8 + 0.85(M − 1) 9 zr.saturation Value Returns a matrix ’results’ with the following columns: M cationic ratios Zr observed Zr concentrations Zr.sat saturation levels of Zr for assumed temperature TZr.sat.C zircon saturation temperatures in C Author(s) Vojtech Janousek, [email protected] References Watson E B & Harrison M (1983) Zircon saturation revisited: temperature and composition effects in a variety of crustal magma types. Earth Planet Sci Lett 64: 295-304 Index ∗Topic file load.file, 4 r2clip, 7 ∗Topic internal acnk, 1 filter.out, 3 millicat, 5 normalize2total, 6 ∗Topic manip ap.saturation, 2 mz.saturation, 5 zr.saturation, 8 acnk, 1 ap.saturation, 2 filter.out, 3 load.file, 4 millicat, 1, 5 mz.saturation, 5 normalize2total, 6 r2clip, 7 Shand (acnk), 1 zr.saturation, 8 10
© Copyright 2026 Paperzz