Skip to content
Prev 277779 / 398506 Next

merging corpora and metadata

Hi Henri-Paul,

This can be rather tricky.  It would really help if you could give us
a reproducible example.  In this case, because you are dealing with
non standard data structures (or at least added attributes), the data
exactly as R "sees" it.  This means either A) code to create some data
that demonstrates your problem or B) the output of calling
dput(corpus.1) (see ?dput for what it does and what to do).

One possibility (though it does not concatenate per se):

combined <- list(corpus.1, corpus.2)

*if* (there are only attributes in corpus.1 OR corpus.2) OR (the
attribute names in corpus.1 and corpus.2 are unique), then you could
do:

combined <- c(corpus.1, corpus.2)
attributes(combined) <- c(attributes(corpus.1), attributes(corpus.2)

but note that it is *very* likely that at least the names attributes
overlap, so you would need to address that somehow.  If attributes
overlap, you need to somehow merge them, and what is an appropriate
way to do that, I have no idea without knowing more about the data and
what is expected by functions that work with it.

Best regards,

Josh

On Thu, Nov 17, 2011 at 1:43 PM, Henri-Paul Indiogine
<hindiogine at gmail.com> wrote: