RTHound: RTHound

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RTHound.R

Description

Identifies the most frequent retweets through hierarchical clustering on Levenshtein distance (dissimilarity) matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
RTHound(
  testo,
  S = 500,
  L = 100,
  hclust.dist = 100,
  hclust.method = "complete",
  showTopN = 5,
  dist = "levenshtein",
  verbatim = TRUE
)

Arguments

testo

Tweets or generic texts vector.

S

Number of tweets (or texts) for each subset. 500 by deafault.

L

Number of tweets (or texts) belonging to the previous subset to embed in subset analysis. 100 by default.

hclust.dist

Numeric scalar with height where the trees should be cut. 100 by deafault.

hclust.method

The agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward", "single", "complete", "average", "mcquitty", "median" or "centroid". "complete" by default.

showTopN

Number of most frequent retweets to show. 5 by deafault.

dist

"levenshtein" is the default. "profile" is the other - quicker - accepted value.

verbatim

logical

Details

RTHound divides testo in subsets of length S (from the second subset also incorporates L tweets of the previous subset); calculate a dissimilarity matrix based on Levenshtein distance for each subsets and clusterize tweets throught hierarchical clustering algorithm.

Value

RTHound replaces the tweets belong to the same cluster with the oldest, identifying them as retweets, and returns a list of the most frequent retweets (top).

Author(s)

Federico Ferraccioli, Livio Finos

See Also

hclust

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 ## Not run: 
 testo=c(
 "RT @LAVonlus: Tre miti da sfatare sulla #vivisezione. Le risposte  ai luoghi comuni della sperimentazione animale  http://t.co/zHSfam16DT",
 "Tre miti da sfatare sulla #vivisezione. Le risposte  ai luoghi comuni della sperimentazione animale  http://t.co/zHSfam16DT",
 "RT @LAVonlus: Tre miti da sfatare sulla #vivisezione. Le risposte  ai luoghi comuni della sperimentazione animale  http://t.co/zHSfam16DT",
 "RT @orianoPER: La #sperimentazioneanimale è inutile perché non predittiva per la specie umana. MEDICI ANTI #VIVISEZIONE- LIMAV http://t.co/" ,
 "La #sperimentazioneanimale è inutile perché non predittiva per la specie umana. MEDICI ANTI #VIVISEZIONE- LIMAV http://t.co/3MwubXIH8g",
 "RT @orianoPER: La #ricerca in #Medicina con #sperimentazioneanimale non e' predittiva per la specie umana. MEDICI ANTI #VIVISEZIONE http://t",
 "RT @HuffPostItalia: Il Governo italiano non fermi la sperimentazione animale. Intervista a Elena Cattaneo http://t.co/q1dm430a9j",
 "RT @HuffPostItalia: \"Il Governo italiano non fermi la sperimentazione animale\". Intervista a Elena Cattaneo http://t.co/q1dm430a9j",
 "\"Il Governo italiano non fermi la sperimentazione animale\". Intervista a Elena Cattaneo http://t.co/q1dm430a9j",
 "RT @orianoPER: @EnricoLetta LA #VIVISEZIONE NON SERVE: PAROLA DI GLAXO-APTUIT http://t.co/mtsHJjDIvu #StopVivisection #SperimentazioneAnima&")
 
 testo=RTHound(testo, S = 3, L = 1, 
                 hclust.dist = 100, hclust.method = "complete",
                 showTopN=3)


## End(Not run)

livioivil/TextWiller documentation built on Nov. 30, 2020, 3:17 a.m.