combine.TRAMPsamples {TRAMPR} | R Documentation |
Combine TRAMPsamples Objects
Description
Combines two TRAMPsamples
objects into one
large TRAMPsamples
object containing all the samples for both
original objects.
Usage
## S3 method for class 'TRAMPsamples'
combine(x, y, rewrite.sample.pk=FALSE, ...)
Arguments
x , y |
|
rewrite.sample.pk |
Logical: If the new sample data ( |
... |
Further arguments passed to or from other methods. |
Details
For a discussion of rewrite.sample.pk
, see the comments on
rewrite.knowns.pk
in the Details of
combine.TRAMPknowns
.
The data
and info
elements of the resulting
TRAMPsamples
object will have union of the columns present in
both sets of samples.
If any additional elements exist as part of the second
TRAMPsamples
object (e.g. passed as ...
to
TRAMPsamples
), these will be ignored with a warning (see
Example).
See Also
combine.TRAMPknowns
, the method for
TRAMPknowns
objects.
Examples
data(demo.samples)
## Let's split the original samples database in two, and recombine.
demo.samples.a <- demo.samples[head(labels(demo.samples), 10)]
demo.samples.b <- demo.samples[tail(labels(demo.samples), 10)]
## Combining these is easy:
demo.samples.c <- combine.TRAMPsamples(demo.samples.a, demo.samples.b)
## There is a warning message because demo.samples.b contains extra
## elements:
names(demo.samples.b)
## In this case, these objects should not be combined, but in other
## cases it may be necessary to rbind() the extra objects together:
## Not run:
demo.samples.c$soilcore <- rbind(demo.samples.a$soilcore,
demo.samples.b$soilcore)
## End(Not run)
## This must be done manually, since there is no way of telling what
## should be done automatically. Ideas/contributions are welcome here.