Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Social media assignment

1 answer below »
Assignment2022.pdf

API Key -
aPBc1ItVUF9INorSmM0HG7ciU
API secret Key
I5Dnpxre9omatNIWqiHWk1Slf4tTk7biWZWzp4Yo6y50pTSOhD
Bearer Token
AAAAAAAAAAAAAAAAAAAAADR2dQEAAAAAFxVD58AS%2Fgl9RbFUjTBSbfBARt0%3DEuzaFf7M7Pr8z0tsVJpb8lI3EieowzsLpwayAXLq89wCu2dYFO
App Name
Joel_SMI
APP ID
XXXXXXXXXX
#Sample codes#
install.packages("rtweet")
li
ary("rtweet")
## Use your own key and secret!
## Don't share your key and secret with others!
key = ""
secret = ""
create_token(
app = "my_twitter_app",
consumer_key = key,
consumer_secret = secret)
tweets = search_tweets("elon musk", n = 100, lang = "en")

API Key -
aPBc1ItVUF9INorSmM0HG7ciU
API secret Key
I5Dnpxre9omatNIWqiHWk1Slf4tTk7biWZWzp4Yo6y50pTSOhD
Bearer Token
AAAAAAAAAAAAAAAAAAAAADR2dQEAAAAAFxVD58AS%2Fgl9RbFUjTBSbfBARt0%3DEuzaFf7M7Pr8z0tsVJpb8lI3EieowzsLpwayAXLq89wCu2dYFO
App Name
Joel_SMI
APP ID
XXXXXXXXXX
#Sample codes#
install.packages("rtweet")
install.packages("Matrix")
install.packages("sna")
install.packages("igraph")
li
ary("rtweet")
li
ary("Matrix")
li
ary("sna")
li
ary("igraph")
key = "aPBc1ItVUF9INorSmM0HG7ciU"
secret = "I5Dnpxre9omatNIWqiHWk1Slf4tTk7biWZWzp4Yo6y50pTSOhD"
create_token(
app = "Joel_SMI",
consumer_key = key,
consumer_secret = secret)
##see if these four tweets can use better search terms related to elon musk and twitter as the
ones given are pretty basic ones
tweets1 = search_tweets("elonmusk", n = 50, lang = "en", include_rts = FALSE)
tweets2 = search_tweets("elonmusk AND twitter", n = 100, lang = "en")
tweets3 = search_tweets("elonmusk BUY twitter", n = 100, lang = "en")
tweets4 = search_tweets("elonmusk OR twitter", n = 50, lang = "en")
## join them into one dataframe
all_tweets =
ind(tweets1,tweets2,tweets3,tweets4)
## create from-to data frame representing retweet/mention
eply connections
#tweets_net <- network_data(tweets, "retweet,mention,reply")
tweets_net = network_data(all_tweets,"mention")
## view edge data frame
tweets_net
## view user_id->screen_name index
all_names = as.data.frame(attr(tweets_net, "idsn"))
## (1) convert directly to graph object representing semantic network
tweets_graph <- network_graph(all_tweets,"mention")
## (2) plot graph via igraph.plotting
plot(tweets_graph)
## Use plot.igraph parameters to make your graph readable
plot(tweets_graph,edge.a
ow.mode='-',vertex.size = 10,vertex.label.cex = 0.7,layout=layout.fruchterman.reingold)
## Convert to undirected
tweets_graph_un = as.undirected(tweets_graph,mode = c("collapse"))
plot(tweets_graph_un,vertex.size = 10,vertex.label.cex = 0.7,layout=layout.fruchterman.reingold)
## Also try simplify to remove loops or multiple edges
## simplify(tweets_graph,remove.multiple = TRUE,remove.loops = TRUE,)
## Create a separate graph for each component of a graph.
components = decompose(tweets_graph)
sapply(components, diameter)
Answered 7 days After Jun 04, 2022

Solution

Mohd answered on Jun 11 2022
80 Votes
Introduction
I got keen on extricating hashtag "Elon Musk", “Elon musk” and “twittertakeover” which connects with twitter takeover which is the trended social media platform deal on the twitter. Throughout recent months, many people have applied their views to Elon Musk's proposed $44 billion takeover of Twitter. The buyout has, differently, been known as an adventure, a show, a conflict, a fight, and "private enterprise denounced any kind of authority." When a story includes somebody as
illiant as Musk, and when the account continues to move as it has, it's not difficult to gin up progressively
ight terms to portray the goings-on.
Twitter information is the data gathered by either the client, the passage, what's in the post, and how clients view or utilize your post. While this could sound to some degree obscure, it's generally because of the gigantic measure of information that can be gathered from a solitary Tweet.
With this data, you can know socioeconomics, all out taps on your profile or the number of individuals that saw your Tweet. This is only a glimpse of something larger, yet understanding the information permits you to realize how it's utilized and the examples of your substance.
Estimating your Twitter information should be possible through various roads. Contingent upon how hearty you need your examination, there are assorted choices to give you oversight or top-to-the-bottom investigation.
Tools
R — a programming language
R Studio — A integrated development environment
igraph— R li
ary for network graphs and network analysis.
dplyr — data manipulation and analysis r package
tweet — importing and formatting twitter data using twitter API
.xlsx — file type
[rtweet, igraph, tidygraph, tidytext, wordcloud, textdata, ggraph] — social network visualization software package.
In this report, I will make sense of the means I went through to separate information from Twitter. I have fetched a total of 300 tweets from twitter using twitter API. Most importantly, you need to acquire Twitter API accreditations from the Twitter Developer site, which are API key, API secret key, Access token, and Access token secret.
Network centrality estimates the impact of a hub still up in the air by its number of edges and position inside the organization. Network Centrality is a critical property of mind-boggling networks that impacts the way of behaving of dynamical cycles, similar to synchronization and pestilence spreading, and can achieve significant data the association of intricate frameworks, similar to our cere
um and society.
Code to fetch and import Data using rtweet package:
key = "I3mJPigEaNjt3oksgZPj9HDBq"
secret = "N9ajKLVmSiFEaSUhawwLKVLTdgJTzTq3hWNYJuuF2tUifi2vrH"
create_token(
app = "varshagowda",
consumer_key = key,
consumer_secret = secret)
tweets1 = search_tweets("elonmusk", n = 50, lang = "en", include_rts = FALSE)
tweets2 = search_tweets("elonmusk AND twitter", n = 100, lang = "en")
tweets3 = search_tweets("elonmusk BUY twitter", n = 100, lang = "en")
tweets4 = search_tweets("elonmusk OR twitter", n = 50, lang = "en")
Gathering the network:
We have determined the following keywords to fetch the relevant data. #Elonmusk, #elon musk and Twitter, #elonmusk buy Twitter and elonmusk or Twitter. After that we have combined that data from different keywords to form a consolidated dataset to do the analysis.
First, we have created a word Cloud to see what the most frequent keywords in tweets and its turn out spacefamily, Twitter, elonmusk and Twittertakeover are most frequent keywords in tweets data.
Then we have created network data using dataset and mentioned items in tweets. Furthermore, we have created directed graph from that network data. Later we have converted undirected network data to unidirectional network data. In order to visualize the cluster and coordination between Elon musk, Elon musk followers and Twitter takeover we have created undirected graph to visualize the relationship. The center of cluster is Elon musk itself. Elonmusk tesla has separate cluster a smaller one on left side of graph that connected to few people .
Degree centrality Degree centrality is the most straightforward centrality measure to process. Review that a hub's certificate is essentially a count of the number of social associations (i.e., edges) it has. The degree centrality for a hub is basically its certificate. A hub with 10 social associations would have a degree centrality of 10. A hub with 1 edge would have a degree centrality of 1.
The in-level of a vertex. The in-degree addresses the number of approaching edges every vertex that has. In a retweet network, in-degree shows the times the client's posts are retweeted. Degree centrality of a...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here