get_interactions The function takes a vector of tweets and a second vector with the usernames that tweeted the messages. It builds a network of retweets (if return.network="retweets"), @-mentions (if return.network="mentions"), or both (if return.network="all.interactions"). The funcion returns an edgelist (if return.graph=F -- default), but it can convert the data frame on the fly to an igraph object (if return.graph=T). Optional arguments include a thrid vector with edge atributes (edge.atribute defaults to NA), an encoding conversion to ASCII (if ascii=TRUE -- default), and an indication of the network as directional or not. As the funcion is built for Twitter data, the argument directed defaults to TRUE. The funcion can be deployed to other sources of relational data, particularly social media.
get_emails_text The function scraps text files for email addresses within the R environment.
get_emails_webpage The function retrieves the email addresses listed in webpages that include email hyperlinks (if email.href=T) or the full body of the document (if email.href=F). This function takes one or multiple vectors of URLs and returns a vector with the emails found in the document (if return.df=F) or a data frame with the original URL(s) followed by emails on that page separated by columns (if return.df=T). The default arguments are return.df=F and email.href=F.
get_url_title This function takes one or multiple vectors of URLs and returns the title of each webpage (if return.df=F) or a data frame with the original URL(s) followed by the webpage title (if return.df=T -- default).
get_url This function resolves short URLs to their actual address.
get_aggieness Simple classifier for agriculture-related tweets
get_socialmedia The function takes one or multiple URLs and returns a data frame with the number of shares, likes, tweets, pins, and hits on Facebook, Twitter, Pinterest, StumbleUpon, LinkedIn, and Reddit for each URL. The resulting data frame includes the following 15 columns:
url URL searched
normalized_url URL returned
fbk_shares number of Facebook shares
fbk_likes number of Facebook likes
fbk_comments number of Facebook comments
fbk_total total number of hits on Facebook
fbk_clicks number of Facebook clicks
twt_tweets number of tweets on Twitter
rdt_score Reddit score
rdt_downs number of downs on Reddit
rdt_ups number of ups on Reddit
rdt_comments number of comments on Reddit
lkn_shares number of LinkedIn shares
stu_views number of StumbleUpon views
pin_counts number of pins on Pinterest
Author: Marco T. Bastos
Date: 2014-10-08
Modified: 2015-06-12
Description: A Set of R Functions for Web and Social Media Analysis
Imports: RCurl, XML, stringr, httr, igraph