SCM Repository

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

Diff of /pkg/man/Source.Rd

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

revision 1256, Thu Sep 12 05:22:21 2013 UTC revision 1257, Thu Sep 19 10:48:07 2013 UTC
# Line 16  Line 16 
16  \alias{pGetElem.DataframeSource}  \alias{pGetElem.DataframeSource}
17  \alias{pGetElem.DirSource}  \alias{pGetElem.DirSource}
18  \alias{pGetElem.VectorSource}  \alias{pGetElem.VectorSource}
19    \alias{Source}
20  \alias{stepNext}  \alias{stepNext}
21  \alias{stepNext.Source}  \alias{stepNext.Source}
22  \title{Access Sources}  \title{Create and Access Sources}
23  \description{  \description{
24    Methods to access sources which abstract input locations, like a    Create and access sources which abstract input locations, like a
25    directory, a connection, or simply an \R vector.    directory, a connection, or simply an \R vector.
26  }  }
27  \usage{  \usage{
28    Source(defaultreader = readPlain, encoding = "unknown", length = NA_integer_,
29           names = NA_character_, position = 0, vectorized = FALSE, class)
30  \method{eoi}{DataframeSource}(x)  \method{eoi}{DataframeSource}(x)
31  \method{eoi}{DirSource}(x)  \method{eoi}{DirSource}(x)
32  \method{eoi}{URISource}(x)  \method{eoi}{URISource}(x)
# Line 40  Line 43 
43  \method{stepNext}{Source}(x)  \method{stepNext}{Source}(x)
44  }  }
45  \arguments{  \arguments{
46    \item{x}{A source.}    \item{x}{a source.}
47      \item{defaultReader}{a reader function (generator).}
48      \item{encoding}{a character specifying the encoding of the elements
49        delivered by the source.}
50      \item{length}{a numeric denoting the number of elements delivered by the
51        source. If the length is unknown in advance it must be set to \code{NA}.}
52      \item{names}{a character vector giving element names.}
53      \item{position}{a numeric indicating the position in the source.}
54      \item{vectorized}{a logical indicating the ability for parallel element
55        access.}
56      \item{class}{a character vector for extending the class attribute.}
57  }  }
58  \details{  \details{
59    The class \code{Source} is implemented as a \code{list} with    The function \code{Source} is a constructor and should be used when creating
60    following components:    custom sources. Internally a source is represented as a \code{list} with the
61    \describe{    class attribute \code{Source}. Custom sources may extend the internal list
62      \item{\code{DefaultReader}}{Object of class \code{function}    structure with additional named components.
       holding a default reader.}  
     \item{\code{Encoding}}{Object of class \code{character} holding the  
       encoding of the texts delivered by the source.}  
     \item{\code{Length}}{Object of class \code{numeric} denoting the  
       number of the elements delivered by the source. If the number  
       cannot be determined in advance it is set to zero.}  
     \item{\code{LoDSupport}}{Object of class \code{logical} indicating  
       whether this source supports load on demand.}  
     \item{\code{Names}}{Object of class \code{character} storing  
       document names.}  
     \item{\code{Position}}{object of class \code{numeric} indicating  
       the position in the source.}  
     \item{\code{Vectorized}}{object of class \code{logical} indicating  
       the ability for parallel element access.}  
64    The function \code{eoi} returns \code{TRUE} if the end of input of the    Each source must provide implementations for the three interface functions
65    source is reached. \code{getElem} fetches the element at the    \code{eoi}, \code{getElem}, and \code{stepNext}. If \code{vectorized} is set
66    current position, whereas \code{pGetElem} retrieves all elements in    \code{pGetElem} must be implemented as well. The function \code{eoi} returns
67    parallel at once. \code{stepNext} increases the position in the source    \code{TRUE} if the end of input of the source is reached.  \code{getElem}
68    to the next element.    fetches the element at the current position, whereas \code{pGetElem} retrieves
69      all elements in parallel at once. Retrieved elements must be encapsulated in a
70      list with the named components \code{content} holding the document and
71      \code{uri} pointing to the origin of the document (e.g., a file path or a
72      connection; \code{NA} if not applicable or unavailable). \code{stepNext}
73      increases the position in the source to the next element.
74  }  }
75  \seealso{  \seealso{
76    \code{\link{getSources}} to list available sources.    \code{\link{getSources}} to list available sources;
77      \code{\link{readPlain}};
78      \code{\link{Encoding}}.
79  }  }
80  \author{Ingo Feinerer}  \author{Ingo Feinerer}

Removed from v.1256  
changed lines
  Added in v.1257
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge