combine.TRAMPsamples {TRAMPR} | R Documentation |
Combines two TRAMPsamples
objects into one
large TRAMPsamples
object containing all the samples for both
original objects.
## S3 method for class 'TRAMPsamples': combine(x, y, rewrite.sample.pk=FALSE, ...)
x, y |
TRAMPsamples objects, containing TRFLP
patterns. |
rewrite.sample.pk |
Logical: If the new sample data (y )
contains sample.pk values that conflict with those in the
original TRAMPsamples object (x ), should the new samples
be renumbered? If this is TRUE , do not rely on any
sample.pk values staying the same for the newly added samples.
sample.pk values in the original TRAMPsamples object
will never be changed. |
... |
Further arguments passed to or from other methods. |
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).
combine.TRAMPknowns
, the method for
TRAMPknowns
objects.
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.