Last data update: 2014.03.03

R: Merge Risoe.BINfileData objects or Risoe BIN-files
merge_Risoe.BINfileDataR Documentation

Merge Risoe.BINfileData objects or Risoe BIN-files

Description

Function allows merging Risoe BIN/BINX files or Risoe.BINfileData objects.

Usage

merge_Risoe.BINfileData(input.objects, output.file,
  keep.position.number = FALSE, position.number.append.gap = 0)

Arguments

input.objects

character or Risoe.BINfileData (required): Character vector with path and files names (e.g. input.objects = c("path/file1.bin", "path/file2.bin") or Risoe.BINfileData objects (e.g. input.objects = c(object1, object2))

output.file

character (optional): File output path and name.
If no value is given, a Risoe.BINfileData is returned instead of a file.

keep.position.number

logical (with default): Allows keeping the original position numbers of the input objects. Otherwise the position numbers are recalculated.

position.number.append.gap

integer (with default): Set the position number gap between merged BIN-file sets, if the option keep.position.number = FALSE is used. See details for further information.

Details

The function allows merging different measurements to one file or one object.
The record IDs are recalculated for the new object. Other values are kept for each object. The number of input objects is not limited.

position.number.append.gap option

If the option keep.position.number = FALSE is used, the position numbers of the new data set are recalculated by adding the highest position number of the previous data set to the each position number of the next data set. For example: The highest position number is 48, then this number will be added to all other position numbers of the next data set (e.g. 1 + 48 = 49)

However, there might be cases where an additional addend (summand) is needed before the next position starts. Example:

Position number set (A): 1,3,5,7
Position number set (B): 1,3,5,7

With no additional summand the new position numbers would be: 1,3,5,7,8,9,10,11. That might be unwanted. Using the argument position.number.append.gap = 1 it will become: 1,3,5,7,9,11,13,15,17.

Value

Returns a file or a Risoe.BINfileData object.

Function version

0.2.4 (2015-11-29 17:27:48)

Note

The validity of the output objects is not further checked.

Author(s)

Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne (France)
R Luminescence Package Team

References

Duller, G., 2007. Analyst.

See Also

Risoe.BINfileData, read_BIN2R, write_R2BIN

Examples



##merge two objects
data(ExampleData.BINfileData, envir = environment())

object1 <- CWOSL.SAR.Data
object2 <- CWOSL.SAR.Data

object.new <- merge_Risoe.BINfileData(c(object1, object2))


Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Luminescence)
Welcome to the R package Luminescence version 0.6.0 [Built: 2016-05-30 16:47:30 UTC]
A weathering rock: 'Who wants to live forever?'
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Luminescence/merge_Risoe.BINfileData.Rd_%03d_medium.png", width=480, height=480)
> ### Name: merge_Risoe.BINfileData
> ### Title: Merge Risoe.BINfileData objects or Risoe BIN-files
> ### Aliases: merge_Risoe.BINfileData
> ### Keywords: IO manip
> 
> ### ** Examples
> 
> 
> 
> ##merge two objects
> data(ExampleData.BINfileData, envir = environment())
> 
> object1 <- CWOSL.SAR.Data
> object2 <- CWOSL.SAR.Data
> 
> object.new <- merge_Risoe.BINfileData(c(object1, object2))
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>