Learn R Programming

bdpar (version 2.0.0)

Bdpar: Class to manage the preprocess of the files throughout the flow of pipes

Description

Bdpar class provides the static variables required to perform the whole data flow process. To this end Bdpar is in charge of (i) initialize the objects of handle the connections to APIs (Connections) and handles json resources (ResourceHandler) and (ii) executing the flow of pipes (inherited from GenericPipeline class) passed as argument.

Usage

Bdpar

Arguments

Constructor

Bdpar$new()

Static variables

  • connections: (Connections) object that handles the connections with YouTube and Twitter.

  • resourceHandler: (ResourceHandler) object that handles the json resources files.

Methods

  • execute: preprocess files through the indicated flow of pipes.

    • Usage:

      execute(path,
              extractors = ExtractorFactory$new(),
              pipeline = GenericPipeline$new())

    • Value: list of Instances that have been preprocessed.

    • Arguments:

      • path: (character) path where the files to be processed are located.

      • extractors: (ExtractorFactory) class which implements the createInstance method to choose which type of Instance is created.

      • pipeline: (GenericPipeline) subclass of GenericPipeline, which implements the execute method.

Details

In the case that some pipe, defined on the workflow, needs some type of configuration, it can be defined throught bdpar.Options variable which have differents methods to support the funcionality of different pipes.

See Also

bdpar.Options, Connections, DefaultPipeline, DynamicPipeline, GenericPipeline,Instance, ExtractorFactory, ResourceHandler, runPipeline

Examples

Run this code
# NOT RUN {
#If it is necessary to indicate any existing configuration key, do it through:
#bdpar.Options$set(key, value)
#If the key is not initialized, do it through:
#bdpar.Options$add(key, value)

#Folder with the files to preprocess
path <- system.file(file.path("example"),
                    package = "bdpar")

#Object which decides how creates the instances
extractors <- ExtractorFactory$new()

#Object which indicates the pipes' flow
pipeline <- DefaultPipeline$new()

objectBdpar <- Bdpar$new()

#Starting file preprocessing...
objectBdpar$execute(path = path,
                    extractors = extractors,
                    pipeline = pipeline)
# }

Run the code above in your browser using DataLab