feature_orthographic: Orthographic features

Description Usage Arguments Details Value Examples

View source: R/feature_engineering.R

Description

Engineers orthographic features in Tweets.

Usage

1
feature_orthographic(data, doc_id_field, text_field)

Arguments

data

a dataframe or tibble containing the text data and document id

doc_id_field

unquoted field name identifying the field within the data that represents the unique document id

text_field

unquoted field name identifying the field name in data that contains the text of the Tweet

Details

As part of the pre-processing to calculate these features, usernames containing @ are removed, as are hashtags.

The orthographic features are calculated as a proportion of the total number of characters in the Tweet prior to the pre-processing steps above:

Value

A data frame of document ids their associated orthographic features

Examples

1
2
3
4
5
tweets <- data.frame(status_id = c(1234, 5678),
                     text = c("I tweet about one thing! #onething #things",
                              "I tweet about another thing!?%$ #another thing #things"),
                     stringsAsFactors = FALSE)
feature_orthographic(tweets, status_id, text)

sebastian-fox/twitterfeatures documentation built on Nov. 5, 2019, 8:47 a.m.