Package 'rxylib'

Title: Import XY-Data into R
Description: Provides access to the 'xylib' C library for to import xy data from powder diffraction, spectroscopy and other experimental methods.
Authors: Sebastian Kreutzer [aut, trl, cre] , Johannes Friedrich [aut] , RLum Team [ctb], Marcin Wojdyr [cph] (C++ library 'xylib'), Peng Zhang [cph] (C++ library 'xylib')
Maintainer: Sebastian Kreutzer <[email protected]>
License: GPL-3 | LGPL-2.1
Version: 0.2.15.9000-1
Built: 2024-08-27 13:20:36 UTC
Source: https://github.com/r-lum/rxylib

Help Index


Import XY-Data into R rxylib.svg

Description

Provides access to the 'xylib' C++ library for to import xy data from powder diffraction, spectroscopy and other experimental methods, like gamma-ray spectrometry.

License: GPL-3 | LGPL-2.1 (for the C++ library 'xylib')

Details

Funding

Between 2017-2019, the work of Sebastian Kreutzer as maintainer of the package was supported by LabEx LaScArBx (ANR - n. ANR-10-LABX-52).

From 01/2020-04/2022, Sebastian Kreutzer received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 844457 (project: CREDit).

Supported data formats:
library version: 1.6.0

ID NAME DESCRIPTION FILE EXTENSION VALID_OPTIONS DATATYPE BLOCK_TYPE
[1,] cpi Sietronics Sieray CPI cpi ascii single
[2,] uxd Bruker Diffrac-AT UXD uxd ascii multiple
[3,] rigaku_dat Rigaku DAT dat ascii multiple
[4,] bruker_raw Siemens/Bruker RAW raw binary multiple
[5,] bruker_spc Bruker ESP300-E SPC spc binary single
[6,] vamas VAMAS ISO-14976 vms ascii multiple
[7,] philips_udf Philips UDF udf ascii single
[8,] spe PI WinSpec SPE spe binary multiple
[9,] pdcif Powder Diffraction CIF cif ascii multiple
[10,] philips_rd Philips PC-APD RD/SD rd sd binary single
[11,] xrdml PANalytical XRDML xrdml ascii multiple
[12,] canberra_mca Canberra MCA mca dat binary single
[13,] canberra_cnf Canberra CNF cnf binary single
[14,] xfit_xdd XFIT XDD xdd ascii single
[15,] riet7 RIET7/LHPM/PSI_DMC dat ascii single
[16,] dbws DBWS data dbw rit neu ascii single
[17,] chiplot ChiPLOT data chi ascii single
[18,] spectra Spectra / VGX 900 1 2 3 4 5 6 7 8 9 ascii multiple
[19,] specsxy SPECS SpecsLab2 xy xy ascii multiple
[20,] csv CSV or TSV csv tsv tab decimal-comma ascii single
[21,] xsyg Freiberg Instruments XSYG xsyg ascii multiple

Author(s)

Sebastian Kreutzer, Institute of Geography, Ruprecht-Karl-University of Heidelberg (Germany), Johannes Friedrich (University of Bayreuth, Germany), RLum Team (family support), Marcin Wojdyr (maintainer and author of the C++ library xylib), Peng Zhang (author of the C++ library xylib)

See Also

Useful links:


Convert xy-data to TKA

Description

Convert data to the Toolkit file format (TKA) as exported by, e.g., by the software Canberra Genie 2000.

Usage

convert_xy2TKA(object, file = NULL, overwrite = FALSE)

Arguments

object

rxylib (required): xy data as imported by the function read_xyData. Optional a file supported by the rxylib-package can be provided as input. Arguments can be provided as list.

file

character (optional): optional file path or file name for the output to be written. If only a path is provided the output file name is derived from the input file name. Argument can be provided as list.

overwrite

logical (with default): force overwriting of existing files if TRUE.

Details

Supported formats

  • Canberra CNF

  • further formats on request ...

Value

Returns a list of matrix objects or an output TKA-file.

Function version

0.1.1

How to cite

Kreutzer, S., 2024. convert_xy2TKA(): Convert xy-data to TKA. Function version 0.1.1. In: Kreutzer, S., Friedrich, J., 2024. rxylib: Import XY-Data into R . R package version 0.2.15.9000-1. https://r-lum.github.io/rxylib/

Author(s)

Sebastian Kreutzer, Institute of Geography, Universität Heidelberg, Germany

Examples

##convert CNF data (no export to file system)
convert_xy2TKA(
 object = system.file("extdata/ExampleSpectrum.CNF", package = "rxylib"))

## Not run: 
##export as file

##create temporary filepath
##(for usage replace by own path)
temp_file <- tempfile(pattern = "output", fileext = ".TKA")

##convert and write to file system
convert_xy2TKA(
 object = system.file("extdata/ExampleSpectrum.CNF", package = "rxylib"),
 file = temp_file)


## End(Not run)

methods_rxylib

Description

S3-methods support by the package rxylib. Listed functions can be passed directly into S3 generics (e.g., plot, print) without reshaping the data.

Usage

## S3 method for class 'rxylib'
print(x, ...)

## S3 method for class 'rxylib'
plot(x, block = NULL, ...)

Arguments

x

(required): input object

...

further arguments that can be passed to the method

block

numeric (with default): select block for plotting, e.g. c(1:2).


Import xy-Data for Supported Formats into R

Description

The function provides access to the underlying xylib to import data for supported file formats into R. In most cases, only the file path is needed with further arguments to import the data. The function automatically recognises allowed formats. See rxylib-package for supported formats.

Usage

read_xyData(file, options = "", verbose = TRUE, metaData = TRUE)

Arguments

file

character (required): path and file to be imported. The argument accepts an URL. Can be character vector or a list of characters.

options

character (with default): set format options (see rxylib-package)

verbose

logical (with default): enables/disables verbose mode

metaData

logical (with default): enables/disables the export of metadata

Value

The functions returns a list of matrices.

Function version

0.3.0

How to cite

Kreutzer, S., Friedrich, J., 2024. read_xyData(): Import xy-Data for Supported Formats into R. Function version 0.3.0. In: Kreutzer, S., Friedrich, J., 2024. rxylib: Import XY-Data into R . R package version 0.2.15.9000-1. https://r-lum.github.io/rxylib/

Author(s)

Sebastian Kreutzer, Institute of Geography, Ruprecht-Karl-University of Heidelberg (Germany), Johannes Friedrich, University of Bayreuth (Germany)

Examples

##load example dataset
file <- system.file("extdata/ExampleSpectrum.CNF", package = "rxylib")
results <- read_xyData(file)
results

##plot xy-spectrum
plot(results,
 type = "l",
 xlab = "Energy [keV]",
 ylab = "Counts",
 main = "Thorite - 1800 s")

mtext(side = 3, "Canberra Inspector 1000, 3 x 3 NaI probe")

##plot contour for TL-spectrum
##imported from an XSYG-file
spectrum <- read_xyData(system.file("extdata/TLSpectrum.xsyg", package = "rxylib"))
contour(
 x = spectrum$dataset[[1]]$data_block[,1],
 y = 1:ncol(spectrum$dataset[[1]]$data_block[,-1]),
 z = spectrum$dataset[[1]]$data_block[,-1],
 xlab = "Wavelength [nm]",
 ylab = "#Channel",
 main = "TL Spectrum")