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 <- crystMW(pattern, N = 41, iter = 100)
# 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