cleanTxt: Funzione per la pulizia dei testi

Description Usage Arguments Value Examples

View source: R/cleanTxt.R

Description

Questa funzione facilita le operazioni di pre-trattamento e pulizia dei testi, permettendo di personalizzare le operazioni che si vogliono eseguire. Di default:

Usage

1
2
cleanTxt(x = NULL, conv = FALSE, hash = TRUE, hashlist = NULL,
  mention = TRUE, mentlist = NULL, numeri = FALSE, minusc = TRUE)

Arguments

x

Vettore dei testi (tweets).

conv

Logico, se TRUE converte da UTF-8 a latin1.

hash

Logico, se TRUE rimuove per intero gli hashtags.

hashlist

Lista con gli hashtags, necessaria se hash = FALSE (è la lista hashtag nell’oggetto tweet, restituito da get_timeline o da search_tweet).

mention

Logico, se TRUE rimuove per intero le mentions.

mentlist

Lista con le mentions, necessaria se mention = FALSE (oggetto.tweet$mentions_screen_name).

numeri

Logico, se TRUE rimuove tutti i numeri.

minusc

Logico, se TRUE trasforma i testi in minuscolo.

Value

Il vettore dei testi pulito, più semplice da utilizzare per le analisi.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

tw_amala <- search_tweets(
q = "inter", n = 5000, type = "recent", include_rts = T, lang="it"
)

cleanTxt(
tw_amala$text,
conv = TRUE,
hash = TRUE,
mention = TRUE,
numeri = TRUE
minusc = TRUE)

## End(Not run)

PaoloDalena/banchedatiz documentation built on Jan. 2, 2021, 9:15 a.m.