regroup.powdRafps: regroup

Description Usage Arguments Details Value Examples

View source: R/regroup.R

Description

regroup.powdRafps allows an alternative grouping structure to be applied to powdRafps objects.

Usage

1
2
## S3 method for class 'powdRafps'
regroup(x, y, ...)

Arguments

x

A powdRafps object

y

A data frame. First column contains the phase IDs covering all those present in x$phases$phase_id. Second column contains the desired grouping of each phase.

...

other arguments

Details

powdRafps objects contain a data frame called phases_grouped that summarises phase concentrations based on defined mineral groups from the powdRlib reference library. regroup allows you to change this grouping structure by supplying new group identities.

Value

a powdRafps object with components:

tth

a vector of the 2theta scale of the fitted data

fitted

a vector of the count intensities of fitted XRPD pattern

measured

a vector of the count intensities of original XRPD measurement (aligned)

residuals

a vector of the residuals (measured minus fitted)

phases

a dataframe of the phases used to produce the fitted pattern

phases_grouped

the phases dataframe grouped and summed by phase_name

obj

named vector of the objective parameters summarising the quality of the fit

weighted_pure_patterns

a dataframe of reference patterns used to produce the fitted pattern. All patterns have been weighted according to the coefficients used in the fit

coefficients

a named vector of coefficients used to produce the fitted pattern

inputs

a list of input arguments used in the function call

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Load the minerals library
data(minerals)

# Load the soils data
data(soils)

#Load the regrouping structure
data(minerals_regroup)

## Not run: 
afps_sandstone <- afps(lib = minerals,
                       smpl = soils$sandstone,
                       std = "QUA.2",
                       align = 0.2,
                       lod = 0.2,
                       amorphous = "ORG",
                       amorphous_lod = 1)

afps_sandstone_regrouped <- regroup(afps_sandstone,
                                    minerals_regroup)

afps_sandstone_regrouped$phases_grouped

## End(Not run)

powdR documentation built on Aug. 13, 2021, 5:08 p.m.