knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

Build Status CRAN_Status_Badge Total_Downloads

Overview

powdR is an implementation of the full pattern summation approach to quantitative mineralogy from X-ray powder diffraction data [@Chipera2002;@Chipera2013;@Eberl2003].

powdR has several advantages over the excel based implementations of full pattern summation such as FULLPAT [@Chipera2002] and RockJock [@Eberl2003]. First, computation is faster and, when quantifying multiple samples, can be used in combination with other packages (e.g foreach and doParallel) for parallel processing. Secondly, powdR can be run via a Shiny web application, which offers a user friendly interface for fast and iterative mineral quantification. Lastly, R represents a powerful tool for data manipulation, allowing users to creatively adapt, pre-treat and visualise their data.

Installation

The stable version of powdR is on CRAN:

install.packages("powdR")

Alternatively, the development version can be downloaded from GitHub

#Install devtools if you don't already have it on your machine
install.packages("devtools")

devtools::install_github('benmbutler/powdR')

Usage

library(powdR)

#Load some soils to quantify
data(soils)

#Load a powdRlib reference library of pure patterns
data(minerals)

#Quantify a sample
q <-  fps(lib = minerals,
          smpl = soils$sandstone,
          refs = minerals$phases$phase_id,
          std = "QUA.1")

#Inspect the phase concentrations (summarised by name)
q$phases_grouped

#Inspect the quantification
plot(q, wavelength = "Cu")

Alternatively, plot(q, wavelength = "Cu", interactive = TRUE) provides an interactive plot for better inspection of the fit. More detailed usage instructions are provided in the package vignette.

The powdR Shiny app

To run powdR via the Shiny app, use run_powdR(). This loads the application in your default web browser. The application has six tabs:

  1. Reference Library Builder: Allows you to create and export a powdRlib reference library from two .csv files: one for the XRPD measurements, and the other for the ID, name and reference intensity ratio of each pattern.
  2. Reference Library Viewer: Facilitates quick inspection of the phases within a powdRlib reference library.
  3. Reference Library Editor: Allows the user to easily subset a powdRlib reference library .
  4. Full Pattern Summation: A user friendly interface for manual and automated full pattern summation of single samples.
  5. Results Viewer/Editor: Allows for results from previously saved powdRfps and powdRafps objects to be viewed and edited via addition or removal of reference patterns.
  6. Help Provides a series of video tutorials (via YouTube) detailing the use of the powdR Shiny application.

Please note that the powdR Shiny app may not work in the Microsoft Edge internet browser.

References



benmbutler/powdR documentation built on Nov. 29, 2021, 1:05 p.m.