SCM

SCM Repository

[tm] Diff of /pkg/man/DataframeSource.Rd
ViewVC logotype

Diff of /pkg/man/DataframeSource.Rd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1480, Fri Apr 28 15:13:08 2017 UTC revision 1481, Sat May 20 10:28:00 2017 UTC
# Line 8  Line 8 
8  DataframeSource(x)  DataframeSource(x)
9  }  }
10  \arguments{  \arguments{
11    \item{x}{A data frame giving the texts.}    \item{x}{A data frame giving the texts and metadata.}
12  }  }
13  \details{  \details{
14    A \emph{data frame source} interprets each row of the data frame \code{x} as a    A \emph{data frame source} interprets each row of the data frame \code{x} as a
15    document.    document. The first column must be named \code{"doc_id"} and contain a unique
16      string identifier for each document. The second column must be named
17      \code{"text"} and contain a \code{"UTF-8"} encoded string representing the
18      document's content. Optional additional columns are used as document level
19      metadata.
20  }  }
21  \value{  \value{
22    An object inheriting from \code{DataframeSource}, \code{\link{SimpleSource}},    An object inheriting from \code{DataframeSource}, \code{\link{SimpleSource}},
# Line 20  Line 24 
24  }  }
25  \seealso{  \seealso{
26    \code{\link{Source}} for basic information on the source infrastructure    \code{\link{Source}} for basic information on the source infrastructure
27    employed by package \pkg{tm}.    employed by package \pkg{tm}, and \code{\link{meta}} for types of metadata.
28    
29      \code{\link[readtext]{readtext}} for reading in a text in multiple formats
30      suitable to be processed by \code{DataframeSource}.
31  }  }
32  \examples{  \examples{
33  docs <- data.frame(c("This is a text.", "This another one."))  docs <- data.frame(doc_id = c("doc_1", "doc_2"),
34                       text = c("This is a text.", "This another one."),
35                       dmeta1 = 1:2, dmeta2 = letters[1:2],
36                       stringsAsFactors = FALSE)
37  (ds <- DataframeSource(docs))  (ds <- DataframeSource(docs))
38  inspect(VCorpus(ds))  x <- Corpus(ds)
39    inspect(x)
40    meta(x)
41  }  }

Legend:
Removed from v.1480  
changed lines
  Added in v.1481

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge