ExtractorTwtid: Class to handle tweets files with twtid extension

ExtractorTwtidR Documentation

Class to handle tweets files with twtid extension

Description

This class inherits from the Instance class and implements the functions of extracting the text and the date of an twtid type file.

Details

Twitter connection is handled through the Connections class which loads the Twitter API credentials from the bdpar.Options object. Additionally, to increase the processing speed, each twitter query is stored in a cache to avoid the execution of duplicated queries. To enable this option, cache location should be in the "cache.twitter.path" field of bdpar.Options variable. This variable has to be the path to store the tweets and it is necessary that it has two folder named: "_spam_" and "_ham_"

Inherit

This class inherits from Instance and implements the obtainSource and obtainDate abstracts functions.

Super class

bdpar::Instance -> ExtractorTwtid

Methods

Public methods

Inherited methods

Method new()

Creates a ExtractorTwtid object.

Usage
ExtractorTwtid$new(path, cachePath = NULL)
Arguments
path

A character value. Path of the twtid file.

cachePath

A character value. Path of the cache location. If it is NULL, checks if is defined in the "cache.twitter.path" field of bdpar.Options variable.


Method obtainId()

Obtains the ID of an specific tweet. Reads the ID of the file indicated in the variable path.

Usage
ExtractorTwtid$obtainId()

Method getId()

Gets the ID of an specific tweet.

Usage
ExtractorTwtid$getId()
Returns

Value of tweet ID.


Method obtainDate()

Obtains the date from a specific tweet ID. If the tweet has been previously cached the tweet date is loaded from cache path. Otherwise, the request is performed using Twitter API and the date is automatically formatted to "

Usage
ExtractorTwtid$obtainDate()

Method obtainSource()

Obtains the source from a specific tweet ID. If the tweet has previously been cached the source is loaded from cache path. Otherwise, the request is performed using on Twitter API.

Usage
ExtractorTwtid$obtainSource()

Method toString()

Returns a character representing the instance

Usage
ExtractorTwtid$toString()
Returns

Instance character representation


Method clone()

The objects of this class are cloneable with this method.

Usage
ExtractorTwtid$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

bdpar.Options, Connections, ExtractorEml, ExtractorSms, ExtractorYtbid, Instance,


bdpar documentation built on Aug. 22, 2022, 5:08 p.m.