This markdown shows some of the data that can be pulled from Twitter in regards to BMW and Mercedes Benz vehicles. The data was pulled from twitter to answer some questions in relation to how users tag these brands, such as when these brands are most tagged throughout a week period, which cities the users that tag these two luxury vehicle brands are located in.
The following packages were required for this analysis:
| PACKAGE | Description |
|---|---|
| readr | Allows the imporation of .csv files |
| Tidyverse | For the tidyverse packages |
| lubridate | To Modify dates for specific analysis |
| knitr | RMarkdown documents |
| rmdformats | RMarkdown themes |
referencing BMW and Mercedes Benz for analysis
# download file from web source
# download.file("https://myxavier-my.sharepoint.com/:x:/g/personal/roehmr_xavier_edu/EXekRVesiUVJpqiVILl3r8IBin-8o3AgKTzvHRSgh4HZFw?download=1","BMW_Merc.csv")
#import file from working directory (Please comment out your download command!)
BMW_Merc <- read_csv("BMW_vs_Merc.csv")
The data that is being pulled are Tweets that utilize the Hashtag “BMWUSA”, which is the official tag for BMW in the USA, and the hashtag “MercedesBenzUSA”, which is the US-centric tag for Mercendes Benz.
What time of day are these luxury brands most tagged? This topic is interesting as it could be an indication of an important event that occurs relative to the luxury brand.
The data: This uses the time the tweets occur using each of the brands hashtag, sorts the date by the hour that the tweet occurred, and plots the number of occurrances in each hour block to determine the timeframe where most tweets occur.
Conclusion: The BMW brand had their BMWUSA hashtag tweeted most in two distinguishable peaks: the first peaking at 1100 hours and the second occurring at 1800 hours. These data points, while acting as peaks, were not significantly higher than any other time of day. The Mercedes Benz brand saw much more tweets occur at 1600 hours, seeing the number of tweets in this time frame outpace the other times by at least 3 to 1.
Which automaker had the most verified users flag their tweets? Typically, a verified status means that you are a VIP, or some level of celebrity. Which brand has the most name association with their vehicles?
The data: This case counts the number of verified users that are labeled as “True” and plots the number of users for each brand.
Conclusion: From the data, it appears that BMW has more verified tweeters than Mercedes-Benz. Therefore, it must be concluded from the limited data, thatBMW is the more likely vehicle to be driven by someone with some level of celebrity status.
What are the top 5 locations for each car brand based on the number of Tweets referencing BMW and Mercedes Benz
The data: will select the brands, and the locations and count the number of times each brand is references in each location. Then it will return a table showing the top five locations for each brand based on tweet location
## # A tibble: 5 x 2
## location BMW_Instances
## <chr> <int>
## 1 Woodcliff Lake, NJ 07675 39
## 2 Houston, TX 17
## 3 Tucson, Arizona 13
## 4 Georgia, USA 12
## 5 Mumbai 7
## # A tibble: 5 x 2
## location MB_Instances
## <chr> <int>
## 1 Atlanta, GA 23
## 2 New York, NY 18
## 3 Lagos Nigeria 17
## 4 United States 17
## 5 New York, USA 16
From the generated tables, we can see that the highest number of BMW related tweets are generated from Woodcliff Lake, NJ and the highest number of Mercedes-Benz related tweets are generated from Atlanta.