align_xy: Align XRPD data to a given standard

Description Usage Arguments Value Examples

View source: R/align_xy.R

Description

See ?align_xy.XY and align_xy.multiXY for method-specific details.

Usage

1
align_xy(x, std, xmin, xmax, xshift, ...)

Arguments

x

an XY or multiXY object.

std

a dataframe of the chosen standard that each sample will be aligned to (column 1 = 2theta, column 2 = counts)

xmin

the minimum 2theta value used during alignment

xmax

the maximum 2theta value used during alignment

xshift

the maximum (positive and negative) 2theta shift that is allowed during alignment

...

other arguments

Value

an XY or multiXY object.

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Load soils xrd data
data(soils)

#Load minerals library
data(minerals)

## Not run: 
#Create a standard quartz pattern to align to
quartz <- data.frame(tth = minerals$tth,
                     counts = minerals$xrd$QUA.1)

#Plot the main quartz peak prior to alignment
plot(soils, wavelength = "Cu",
     xlim = c(26,27),
     normalise = TRUE)

#align data
aligned <- align_xy(soils,
                    std = quartz,
                    xmin = 10,
                    xmax = 60,
                    xshift = 0.2)

#replot data
plot(aligned, wavelength = "Cu",
     xlim = c(26,27),
     normalise = TRUE)

#Alternatively try with a single XY object

unaligned <- as_multi_xy(list("quartz" = quartz,
                             "sandstone" = soils$sandstone))

plot(unaligned, wav = "Cu",
     xlim = c(26,27), normalise = TRUE)

sandstone_a <- align_xy(soils$sandstone,
                        std = quartz,
                        xmin = 10,
                        xmax = 60,
                        xshift = 0.3)

aligned <- as_multi_xy(list("quartz" = quartz,
                            "sandstone" = sandstone_a))

plot(aligned, wav = "Cu",
     xlim = c(26,27), normalise = TRUE)


## End(Not run)

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