Learn R Programming

cryst (version 0.1.0)

xrdplot: Plots the Crystalline Area of a X-Ray Diffraction Pattern of Starch

Description

Produces a graph of the crystalline area of a X-ray diffraction pattern of starch and background.

Usage

xrdplot(pattern, background)

Arguments

pattern
matrix. The matrix of X-ray diffraction pattern. The first row corresponds to Bragg angle 2$\theta$; the second row corresponds to intensity.
background
matrix. The matrix of background shape (curve of the amorphous starch). The first row corresponds to Bragg angle 2$\theta$; the second row corresponds to intensity.

Examples

Run this code
# Convert data frame to matrix, select A-type starch
pattern <- as.matrix(t(XRD[, c("Bragg_angle","A")]))
# List of crystallinity components
crs <- crystMW(pattern, N = 11, iter = 100)
# Original matrix
original <- crs$original
# Background shape
background <- crs$background
# Plots the crystalline area of a XRD pattern
xrdplot(pattern=original, background=background)

Run the code above in your browser using DataLab