Skip to content
Back to formatted view

Raw Message

Message-ID: <1321612260.22924.35.camel@milan>
Date: 2011-11-18T10:31:00Z
From: Milan Bouchet-Valat
Subject: merging corpora and metadata
In-Reply-To: <CAAmySGPF-hgXARxbQ3itWLYUc7fQh3=fmcERzVWtH3kCdgnZwg@mail.gmail.com>

Le jeudi 17 novembre 2011 ? 21:34 -0500, R. Michael Weylandt a ?crit :
> Hi Josh,
> 
> You're absolutely right. I suppose one could set up some sort of S3
> thing for Henri's problem:
> 
> c <- function(..., recursive = FALSE) UseMethod("c")
> c.default <- base::c
> c.corpus <- function(..., recursive = FALSE) {ans = c.default(...);
> attributes(ans) <- c(do.call(attributes, ...))}
> 
> But agreed, it seems deeply risky.
This method already exists in the tm package where the Corpus class
comes from. Henri-Paul, see ?c.Corpus.

Specifically, tot.corpus <- c(corpus.1, corpus.2, recursive=TRUE)
meta(tot.corpus)
works.

It looks weird that recursive=TRUE isn't the default, but the
documentation seems to imply that the merging of meta-data might produce
weird results, so that's probably why it's disabled by default. You may
want to get in touch with Ingo Feinerer about that.


Regards