tweet_info {tweetcheck}R Documentation

Parse a tweet

Description

These functions can be used to validate tweets before posting.

Usage

tweet_info(x)

tweet_permillage(x)

tweet_weighted_length(x)

tweet_is_valid(x)

tweet_valid_range_start(x)

tweet_valid_range_end(x)

tweet_display_range_start(x)

tweet_display_range_end(x)

Arguments

x

A character vector of tweet

Details

Value

tweet_info() returns a dataframe with length(x) rows. The other functions return integer/numeric vectors with length(x) elements.

See Also

tweet_get_mentions() and tweet_autolink()

Examples

tweets <- c(
  "This is a first tweet. Simple!",
  "This tweet tags @hadleywickham and @_wurli",
  "This tweet links {rtweet}: https://docs.ropensci.org/rtweet/",
  "Emojis take up two characters \U1F600\U1F600\U1F600",
  strrep("This tweet is way too long! ", 20)
)

# Dataframe summarising all of the following
tweet_info(tweets)

# Ratio of used characterss to allowed characters
tweet_permillage(tweets)

# Length of the tweet (according to Twitter's rules):
tweet_weighted_length(tweets)

# Logical indicating tweet validity:
tweet_is_valid(tweets)

# Valid range of a tweet
tweet_valid_range_start(tweets)
tweet_valid_range_end(tweets)

# Display range of a tweet
tweet_display_range_start(tweets)
tweet_display_range_end(tweets)

[Package tweetcheck version 0.1.0 Index]