read_xyData | R Documentation |
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.
read_xyData(file, options = "", verbose = TRUE, metaData = TRUE)
file |
character (required): path and file to be imported. The argument accepts an |
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 |
The functions returns a list of matrices.
0.3.0
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.14.9000-2. https://r-lum.github.io/rxylib/
Sebastian Kreutzer, Institute of Geography, Ruprecht-Karl-University of Heidelberg (Germany), Johannes Friedrich, University of Bayreuth (Germany)
##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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.