merging corpora and metadata
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