as_xy: Create an XY object

Description Usage Arguments Value Examples

View source: R/as_xy.R

Description

as_xy takes a data frame of XY XRPD data and ensures that it meets the criteria for an XY object. These requirements include that the data contains 2 columns of numeric data in a dataframe. Once an XY object has been created, it can easily be plotted using the associated plot.XY method.

Usage

1
as_xy(x)

Arguments

x

a data frame (column 1 = 2theta, column 2 = counts)

Value

an XY object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Load soils xrd data
data(rockjock_mixtures)

xy <- as_xy(rockjock_mixtures$Mix1)

class(xy)

## Not run: 
plot(xy, wavelength = "Cu")
plot(xy, wavelength = "Cu", interactive = TRUE)

## End(Not run)

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