This function creates a text corpus from node or edge text attribute data in an igraph.
corpusFromGraph(
g = NULL,
txt_attr = NULL,
type = "vertex",
iconv = FALSE,
html_decode = TRUE,
rm_url = TRUE,
rm_num = TRUE,
rm_punct = TRUE,
rm_twit_hashtags = FALSE,
rm_twit_users = FALSE,
sw_kind = "SMART",
rm_words = NULL,
stem = FALSE
)
an igraph graph object.
Character string. Name of graph text attribute. Default is NULL
.
Character string. Graph attribute type. Default is "vertex"
.
Logical. Use the iconv
function to attempt UTF8 conversion. Default is FALSE
.
Logical. HTML decode text. Default is TRUE
.
Logical. Remove URL's. Default is TRUE
.
Logical. Remove numbers. Default is TRUE
.
Logical. Remove punctuation. Default is TRUE
.
Logical. Remove twitter hashtags. Default is FALSE
.
Logical. Remove twitter user names. Default is FALSE
.
Character string. Stopword dictionary. Refer stopwords
kind
parameter.
Default is "SMART"
.
Character vector. User defined stopwords. Default is NULL
.
Logical. Apply word stemming. Default is FALSE
.
A tm text corpus object.