| root.merge.data {xps} | R Documentation |
Create class DataTreeSet by merging different ROOT data files.
root.merge.data(xps.scheme, rootfiles = list(), celnames = "*")
xps.scheme |
A SchemeTreeSet containing the correct scheme for the ROOT data file. |
rootfiles |
list of ROOT data file(s), including full path. |
celnames |
optional character vector of tree names to get only subset of trees. |
This function allows to merge data trees from different existing ROOT data files.
An S4 class DataTreeSet will be created, serving as R wrapper to the
existing ROOT data file(s) rootfiles.
If the DataTreeSet should only handle a subset of the trees stored in
rootfiles, the tree names must be supplied as vector celnames.
To get the names of all trees stored in separate rootfiles you can call function
getTreeNames first.
A DataTreeSet object.
Christian Stratowa
## get scheme and import CEL-files from package
scheme.test3 <- root.scheme(paste(.path.package("xps"),"schemes/SchemeTest3.root",sep="/"))
data.test3 <- import.data(scheme.test3,"tmp_datatest3",celdir=paste(.path.package("xps"),"raw",sep="/"),verbose=FALSE)
## get subset of CEL-files
subdataA <- root.data(scheme.test3,"tmp_datatest3_cel.root", celnames=c("TestA1.cel","TestA2.cel"))
subdataB <- root.data(scheme.test3,"tmp_datatest3_cel.root", celnames=c("TestB1.cel","TestB2.cel"))
## merge data
dataAB <- root.merge.data(scheme.test3,c(rootFile(subdataA),rootFile(subdataB)), celnames=c("TestB1.cel","TestA2.cel","TestB2.cel"))