r {powdR} | R Documentation |
Calculate the R value for a fitted pattern
Description
r
computes the difference between a measured and fitted pattern. See
equation for R in section 2.1 of Butler and Hillier (2021).
Usage
r(measured, fitted, weighting)
Arguments
measured |
a vector of count intensities for a measured pattern |
fitted |
a vector of count intensities for a fitted pattern |
weighting |
an optional weighting vector of the same length as those specified
in |
Value
a single numeric value
References
Butler, B.M., Hillier, S., 2021. powdR: An R package for quantitative mineralogy using full pattern summation of X-ray powder diffraction data. Computers and Geosciences. 147, 104662. doi:10.1016/j.cageo.2020.104662
Examples
# Load soils xrd data
data(soils)
#Load minerals library
data(minerals)
## Not run:
#Produce a fit
fps_sand <- fps(lib = minerals,
smpl = soils$sandstone,
refs = minerals$phases$phase_id,
std = "QUA.1",
align = 0.2)
r(measured = fps_sand$measured,
fitted = fps_sand$fitted)
## End(Not run)