read_BIN2R: Import Risø BIN/BINX-files into R

Description Usage Arguments Details Value Function version How to cite Note Author(s) References See Also Examples

View source: R/read_BIN2R.R

Description

Import a *.bin or a *.binx file produced by a Risoe DA15 and DA20 TL/OSL reader into R.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
read_BIN2R(
  file,
  show.raw.values = FALSE,
  position = NULL,
  n.records = NULL,
  zero_data.rm = TRUE,
  duplicated.rm = FALSE,
  fastForward = FALSE,
  show.record.number = FALSE,
  txtProgressBar = TRUE,
  forced.VersionNumber = NULL,
  ignore.RECTYPE = FALSE,
  pattern = NULL,
  verbose = TRUE,
  ...
)

Arguments

file

character or list (required): path and file name of the BIN/BINX file (URLs are supported). If input is a list it should comprise only characters representing each valid path and BIN/BINX-file names. Alternatively the input character can be just a directory (path), in this case the the function tries to detect and import all BIN/BINX files found in the directory.

show.raw.values

logical (with default): shows raw values from BIN file for LTYPE, DTYPE and LIGHTSOURCE without translation in characters. Can be provided as list if file is a list.

position

numeric (optional): imports only the selected position. Note: the import performance will not benefit by any selection made here. Can be provided as list if file is a list.

n.records

raw (optional): limits the number of imported records. Can be used in combination with show.record.number for debugging purposes, e.g. corrupt BIN-files. Can be provided as list if file is a list.

zero_data.rm

logical (with default): remove erroneous data with no count values. As such data are usally not needed for the subsequent data analysis they will be removed by default. Can be provided as list if file is a list.

duplicated.rm

logical (with default): remove duplicated entries if TRUE. This may happen due to an erroneous produced BIN/BINX-file. This option compares only predeccessor and successor. Can be provided as list if file is a list.

fastForward

logical (with default): if TRUE for a more efficient data processing only a list of RLum.Analysis objects is returned instead of a Risoe.BINfileData object. Can be provided as list if file is a list.

show.record.number

logical (with default): shows record number of the imported record, for debugging usage only. Can be provided as list if file is a list.

txtProgressBar

logical (with default): enables or disables txtProgressBar.

forced.VersionNumber

integer (optional): allows to cheat the version number check in the function by own values for cases where the BIN-file version is not supported. Can be provided as list if file is a list.

Note: The usage is at own risk, only supported BIN-file versions have been tested.

ignore.RECTYPE

logical (with default): this argument allows to ignore values in the byte 'RECTYPE' (BIN-file version 08), in case there are not documented or faulty set. In this case the corrupted records are skipped.

pattern

character (optional): argument that is used if only a path is provided. The argument will than be passed to the function list.files used internally to construct a list of wanted files

verbose

logical (with default): enables or disables verbose mode

...

further arguments that will be passed to the function Risoe.BINfileData2RLum.Analysis. Please note that any matching argument automatically sets fastForward = TRUE

Details

The binary data file is parsed byte by byte following the data structure published in the Appendices of the Analyst manual p. 42.

For the general BIN/BINX-file structure, the reader is referred to the Risoe website: http://www.nutech.dtu.dk/

Value

Returns an S4 Risoe.BINfileData object containing two slots:

METADATA

A data.frame containing all variables stored in the bin-file.

DATA

A list containing a numeric vector of the measured data. The ID corresponds to the record ID in METADATA.

If fastForward = TRUE a list of RLum.Analysis object is returned. The internal coercing is done using the function Risoe.BINfileData2RLum.Analysis

Function version

0.16.1

How to cite

Kreutzer, S., Fuchs, M.C., 2019. read_BIN2R(): Import Risø BIN/BINX-files into R. Function version 0.16.1. In: Kreutzer, S., Burow, C., Dietze, M., Fuchs, M.C., Schmidt, C., Fischer, M., Friedrich, J., 2019. Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 0.9.6. https://CRAN.R-project.org/package=Luminescence

Note

The function works for BIN/BINX-format versions 03, 04, 05, 06, 07 and 08. The version number depends on the used Sequence Editor.

ROI data sets introduced with BIN-file version 8 are not supported and skipped durint import.

Author(s)

Sebastian Kreutzer, IRAMAT-CRP2A, UMR 5060, CNRS - Université Bordeaux Montaigne (France)
Margret C. Fuchs, HZDR Freiberg, (Germany)
based on information provided by Torben Lapp and Karsten Bracht Nielsen (Risø DTU, Denmark) , RLum Developer Team

References

DTU Nutech, 2016. The Squence Editor, Users Manual, February, 2016. http://www.nutech.dtu.dk/english/products-and-services/radiation-instruments/tl_osl_reader/manuals

See Also

write_R2BIN, Risoe.BINfileData, base::readBin, merge_Risoe.BINfileData, RLum.Analysis utils::txtProgressBar, list.files

Examples

1
2
3
4
5
##(1) import Risoe BIN-file to R (uncomment for usage)

#FILE <- file.choose()
#temp <- read_BIN2R(FILE)
#temp

R-Lum/Luminescence documentation built on Dec. 5, 2019, 5:23 a.m.