extract_xy: Import and extract XY data from proprietary files

Description Usage Arguments Value Examples

View source: R/extract_xy.R

Description

extract_xy is a wrapper for read_xyData of the rxylib package, which extracts the xy data from various proprietary formats of X-ray powder diffraction data using the xylib C++ library. For more information see ?rxylib and ?rxylib::read_xyData.

Usage

1

Arguments

files

path of the file(s) to be imported.

Value

If only one path is supplied then an XY data frame with 2 columns is returned, the first being the 2theta axis and the second being the count intensities. If more than one path is supplied then a multiXY list is returned, with each item in the list being an XY data frame as already described.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#load example RAW file
file <- system.file("extdata/D5000/RAW/D5000_1.RAW", package = "powdR")
raw1 <- extract_xy(file)

#Load multiple RAW files
files <- dir(system.file("extdata/D5000/RAW", package = "powdR"),
             full.names = TRUE)
raw_list <- extract_xy(files)

class(raw_list)

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

## End(Not run)

benmbutler/powdR documentation built on Nov. 29, 2021, 1:05 p.m.