Learn R Programming

powdR (version 1.3.0)

as_xy: Create an XY object

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

as_xy(x)

Arguments

x

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

Value

an XY object.

Examples

Run this code
# NOT RUN {
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab