data(XRD)
# Convert data frame to matrix, select A-type starch
pattern <- as.matrix(t(XRD[, c("Bragg_angle","A")]))
# List of crystallinity components
crs <- crystSG(pattern, N = 101, iter = 400, p = 2)
# Original matrix
original <- crs$original
# Background shape
background <- crs$background
# Curve of the crystalline starch
corrected <- crs$corrected
# Summary calculation of crystallinity
summary <- crs$summary
Run the code above in your browser using DataLab