# you need to use your own key, which can be obtain from tweeter
# api_key <- "xxxxxxxxxxxxxxxxxxxxxxxxx"
# api_secret <- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# access_token <- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# access_token_secret <- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
setup_twitter_oauth(api_key,api_secret,access_token,access_token_secret)
## [1] "Using direct authentication"
tweets = searchTwitter("#MachineLearning", n=150)
tweet_txt = sapply(tweets, function(x) x$getText())
# regular expressions to find retweets
grep("(RT|via)((?:\\b\\W*@\\w+)+)", tweets, ignore.case=TRUE, value=TRUE)
## character(0)
# which tweets are retweets
rt_patterns = grep("(RT|via)((?:\\b\\W*@\\w+)+)", tweet_txt, ignore.case=TRUE)
# show retweets (these are the ones we want to focus on)
tweet_txt[rt_patterns]
## [1] "RT @jlmico: #MachineLearning and #CyberSecurity Resources: https://t.co/YVqNc1MaJ4 #ML #BigData #DataScience #InfoSec\nhttps://t.co/dQ4s99RmÂ…"
## [2] "RT @DD_Wen_: Cluster Analysis and Unsupervised Machine Learning in Python https://t.co/0vG8f9GGY7 #Python #MachineLearning"
## [3] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [4] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [5] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [6] "RT @JimMarous: The Cognitive Banking Ecosystem for 1:1 Targeting\n\nhttps://t.co/pkbZbo5ITN \n\n#fintech #banking #AI #machinelearning #data #Â…"
## [7] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [8] "RT @TamaraMcCleary: #AI: By 2020, smart agents will manage 40% of #mobile interactions. #bots #machinelearning https://t.co/NYz1WvcRzC"
## [9] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [10] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [11] "RT @BourseetTrading: #GoogleÂ’s #MachineLearning #software can recognize human voices with 95% accuracy\n#AI #IoT #Bigdata @Google https://t.Â…"
## [12] "RT @BourseetTrading: #GoogleÂ’s #MachineLearning #software can recognize human voices with 95% accuracy\n#AI #IoT #Bigdata @Google https://t.Â…"
## [13] "RT @porestar: It's been an amazing #hackathon thanks to the fantastic organisers of #subhack from @Total and @agilegeo #MachineLearning httÂ…"
## [14] "RT @SentiNewsApp: Using #MachineLearning and #BigData #Analytics to Improve Existing #Business Syste\nhttps://t.co/RhuAc4kewn #AI #ML #IoT #Â…"
## [15] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [16] "RT @porestar: 4 way camera system plus desktop sharing and mentimeter live voting! #hackathon #MachineLearning https://t.co/KcLFZaoq5u"
## [17] "RT @mapr: 4 Hot #BusinessIntelligence Trends: #PredictiveAnalytics & #MachineLearning Hits Its Stride (Part 3 of 4): https://t.co/Xr8tpgxkPÂ…"
## [18] "RT @jlmico: 5 Career Paths in #BigData and #DataScience, Explained: https://t.co/aVrV3EPQXJ #MachineLearning #Analytics\nhttps://t.co/Aro8uIÂ…"
## [19] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [20] "RT @porestar: It's demo time! #subhack #machinelearning #hackathon @Total @agilegeo https://t.co/GKQionYoAZ"
## [21] "RT @porestar: 4 way camera system plus desktop sharing and mentimeter live voting! #hackathon #MachineLearning https://t.co/KcLFZaoq5u"
## [22] "RT @royalsociety: How #machinelearning is already shaping the world around us in surprising & exciting ways https://t.co/D6ClpeOZbl #rsmacÂ…"
## [23] "RT @ALSALHAN: How do you describe what #AI can do? #machinelearning #bigdata #fintech #ArtificialIntelligence #robotics #neuroscience #EnteÂ…"
## [24] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [25] "RT @Anita_Pralija: The Future Of #AI https://t.co/aiyMtaCYVu Â… @kuriharan @evankirstel #machinelearning #BigData #deeplearning #CyberSecuriÂ…"
## [26] "RT @JimMarous: A Guide to the @intel #IoT Infographic\n\nhttps://t.co/Hssr0iynDB \n\n #MachineLearning #IIoT #Industry40 #AI #bigdata #InternetÂ…"
## [27] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [28] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [29] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [30] "RT @jlmico: #MachineLearning overtaking #BigData? https://t.co/jjIyBvHwXt #DataScience #Analytics #ML\nhttps://t.co/n6zf7DZTqx"
## [31] "RT @JimMarous: Great Explanation of #AR, #MR and #VR by @LoharPrasanna\n\n@LoharPrasanna\n\n#machinelearning #AugmentedReality #VirtualRealityÂ…"
## [32] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [33] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [34] "RT @AnsonMcCade: How do you describe what #AI can do? #machinelearning #bigdata #fintech #ArtificialIntelligence #robotics #neuroscience htÂ…"
## [35] "RT @Anita_Pralija: The Future Of #AI https://t.co/aiyMtaCYVu Â… @kuriharan @evankirstel #machinelearning #BigData #deeplearning #CyberSecuriÂ…"
## [36] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [37] "RT @ALSALHAN: How do you describe what #AI can do? #machinelearning #bigdata #fintech #ArtificialIntelligence #robotics #neuroscience #EnteÂ…"
## [38] "RT @royalsociety: How #machinelearning is already shaping the world around us in surprising & exciting ways https://t.co/D6ClpeOZbl #rsmacÂ…"
## [39] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [40] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [41] "RT @JimMarous: Harnessing the power of #artificialintelligence and #machinelearning.\n\nhttps://t.co/2JhrMLnTMO\n\n@DeepLearn007 #digital #AI #Â…"
## [42] "RT @psb_dc: The State of Artificial Intelligence Report\n\n#AI #MachineLearning #healthcare #fintech #insurtech @CBinsights \n\nhttps://t.co/gHÂ…"
## [43] "RT @kdnuggets: 20+ hottest research papers on Computer Vision, #MachineLearning #KDN https://t.co/2th9Cdr4Ln https://t.co/mOQxoWxx2x"
## [44] "RT @orzota: Check Out These Top 6 #MachineLearning Trends! #BigData #ML\n\nhttps://t.co/BY1rqTJz8L"
## [45] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [46] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [47] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [48] "RT @orzota: Find Out How Mount Sinai Uses #MachineLearning for Heart Imaging Analytics | #BigData #ML\n\nhttps://t.co/hZtM1OiSBv"
## [49] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [50] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [51] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [52] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [53] "RT @DeepLearn007: JP Morgan on Machine Learning & Big Data\n#AI #machinelearning #bigdata #fintech #deeplearning #ML #DL #tech\nhttps://t.co/Â…"
## [54] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [55] "RT @marcusborba: #MachineLearning and #AI: When to Start? | #DataScience \nhttps://t.co/tPNZ8coqzc"
## [56] "RT @orzota: #MachineLearning To Reinvent Business | via @vivianrosenthal #BigData #ML\n\nhttps://t.co/PfvsoRyQAG"
## [57] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [58] "RT @KirkDBorne: Incorporating #MachineLearning into Enterprises: https://t.co/lsGns02bLE #BigData #DataScience #MachineIntelligence #AI byÂ…"
## [59] "RT @royalsociety: How #machinelearning is already shaping the world around us in surprising & exciting ways https://t.co/D6ClpeOZbl #rsmacÂ…"
## [60] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [61] "RT @DeepLearn007: JP Morgan on Machine Learning & Big Data\n#AI #machinelearning #bigdata #fintech #deeplearning #ML #DL #tech\nhttps://t.co/Â…"
## [62] "RT @gp_pulipaka: Cheat Sheets of #MachineLearning and Python (and #Math). #BigData #DataScience #AI #Azure #Mathematics #Python \nhttps://t.Â…"
## [63] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [64] "RT @KirkDBorne: What is #RPA?\n\n#Robotics\n#AI\n#ArtificialIntelligence\n#MachineIntelligence\n#MachineLearning\n#DataScience\n#BigData\nat @Pega #Â…"
## [65] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [66] "#MachineLearning in Real Life: Tales from the Trenches to the #Cloud –Part 1 https://t.co/SpwIAqrXL5 via @kdnuggets https://t.co/pRPZfBw3mD"
## [67] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [68] "RT @BourseetTrading: #Machinelearning in the world around you\n#AI #IoT #smartcity #M2M #defstar5 #makeyourownlane #Mpgvip\nhttps://t.co/QYIHÂ…"
## [69] "RT @KirkDBorne: What is #RPA?\n\n#Robotics\n#AI\n#ArtificialIntelligence\n#MachineIntelligence\n#MachineLearning\n#DataScience\n#BigData\nat @Pega #Â…"
## [70] "RT @jblefevre60: JP Morgan on #MachineLearning & #BigData\n#AI #fintech #deeplearning #ML #DL #tech\nhttps://t.co/ByYROWMJyy\nHT @DeepLearn007Â…"
## [71] "RT @DeepLearn007: JP Morgan on Machine Learning & Big Data\n#AI #machinelearning #bigdata #fintech #deeplearning #ML #DL #tech\nhttps://t.co/Â…"
## [72] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [73] "RT @royalsociety: How #machinelearning is already shaping the world around us in surprising & exciting ways https://t.co/D6ClpeOZbl #rsmacÂ…"
## [74] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [75] "RT @KirkDBorne: The #MachineLearning Paradigm: mathematical #algorithms that learn from experience!\n#AI #DeepLearning #DataScience #PredictÂ…"
## [76] "RT @ipfconline1: What is #MachineLearning Really?\n#AI #BigData #Analytics\n#Marketing #Startups #makeyourownlane #SMM #defstar5 #CMO #CEO\n[Â…"
## [77] "RT @cloudpreacher: Small Data versus #BigData! #Transactions #Interactions #Observations #IoT #IIoT #MachineLearning #ArtificialIntelligencÂ…"
## [78] "RT @jblefevre60: #fintech world infographic\n#Insurtech #BigData #Analytics #regtech #payments #WealthTech #AI #IoT #MachineLearning #ML #soÂ…"
## [79] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [80] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [81] "RT @kdnuggets: 20+ hottest research papers on Computer Vision, #MachineLearning #KDN https://t.co/2th9Cdr4Ln https://t.co/mOQxoWxx2x"
## [82] "RT @orzota: #MachineLearning Can Be Utilized to Automate How Businesses Connect to its Data #BigData #ML\n\nhttps://t.co/B3AfnjiGjz"
## [83] "RT @jblefevre60: Top 5 future #technology inventions 2019-2050\n#mobile #mobility #fintech #tech #AI #machinelearning #hologram #smartcard hÂ…"
## [84] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [85] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [86] "RT @ipfconline1: A Simple Neural Network w/ #Python + #Keras\nhttps://t.co/nxLwlqJGFG #DataScience #MachineLearning #DeepLearning @PyImageÂ…"
## [87] "RT @DeepLearn007: RFID Journal Unlocking Intelligence\n#AI #machinelearning #bigdata #ML #IoT #tech \nhttps://t.co/rZgAJX7qHP https://t.co/5LÂ…"
## [88] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [89] "RT @KirkDBorne: Incorporating #MachineLearning into Enterprises: https://t.co/lsGns02bLE #BigData #DataScience #MachineIntelligence #AI byÂ…"
## [90] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [91] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [92] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [93] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [94] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [95] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [96] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [97] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [98] "RT @ipfconline1: A Simple Neural Network w/ #Python + #Keras\nhttps://t.co/nxLwlqJGFG #DataScience #MachineLearning #DeepLearning @PyImageÂ…"
## [99] "RT @gp_pulipaka: How to automate deep learning training with #Kubernetes. #BigData #DeepLearning #MachineLearning #DataScience #AI \nhttps:/Â…"
## [100] "RT @MikeTamir: Build a super fast #AI #DeepLearning #MachineLearning machine for under $1,000 https://t.co/qSbCRYitl1 #DataScience https:/Â…"
## [101] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [102] "RT @MaarekClaire: #bigdata: Machine Learning overtaking Big Data? #MachineLearning https://t.co/rlgy0YVLCX"
## [103] "RT @DeepLearn007: The Big Data banking revolution\n#AI #machinelearning #bigdata #Fintech #ML #Banking #tech \nhttps://t.co/tFoMjOHBzb https:Â…"
## [104] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [105] "RT @gp_pulipaka: Adversarial autoencoders create new medicines in oncology. #BigData #DeepLearning #MachineLearning #DataScience #AI\nhttps:Â…"
## [106] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [107] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [108] "RT @alhalabi_: Great read for anyone thinking about deploying #artificialintelligence , #machinelearning and #deeplearning on their data htÂ…"
## [109] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [110] "RT @unioslo_titan: Video for deg som vil vite hva #AI og #machinelearning er, hvordan det virker og hva det kan gjøre for oss: https://t.co…"
## [111] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [112] "RT @v_vashishta: Quantum Learning Speed-up with Classical Training Data https://t.co/qsxxi5Spog #Quantumcomputing #MachineLearning"
## [113] "RT @DeepLearn007: The Big Data banking revolution\n#AI #machinelearning #bigdata #Fintech #ML #Banking #tech \nhttps://t.co/tFoMjOHBzb https:Â…"
## [114] "RT @reworkhealth: Computer scientists to develop machine learning tools to analyze massive sets of genomic data #machinelearning https://t.Â…"
## [115] "RT @gp_pulipaka: Adversarial autoencoders create new medicines in oncology. #BigData #DeepLearning #MachineLearning #DataScience #AI\nhttps:Â…"
## [116] "RT @alisovino: RT DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nÂ… https://t.co/EhqÂ…"
## [117] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
## [118] "RT @cloudpreacher: Small Data versus #BigData! #Transactions #Interactions #Observations #IoT #IIoT #MachineLearning #ArtificialIntelligencÂ…"
## [119] "RT @DeepLearn007: Machine Learning Enhances Processes Greatly\n#AI #MachineLearning #fintech #ML #CX #tech \nhttps://t.co/sC5RgfM2HB https://Â…"
## [120] "RT @ALSALHAN: How do you describe what #AI can do? #machinelearning #bigdata #fintech #ArtificialIntelligence #robotics #neuroscience #EnteÂ…"
## [121] "RT @gp_pulipaka: Reasons to Switch from TensorFlow to #CNTK. #BigData #DeepLearning #MachineLearning #DataScience #AI #TensorFlow\nhttps://tÂ…"
## [122] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [123] "RT @gp_pulipaka: Artificial Intelligence in Natural Language Processing.#BigData #DeepLearning #MachineLearning #DataScience #AI #NLP\nhttpsÂ…"
## [124] "RT @DeepLearn007: #MachineLearning vs. Quants: Advantages of Machine Learning in Finance\n#AI #fintech #deeplearning #BigData #ML #tech httpÂ…"
## [125] "RT @gp_pulipaka: AI Predicts Autism Based on Infant Brain Scans. #BigData #DeepLearning #MachineLearning #DataScience #AI \nhttps://t.co/PFzÂ…"
## [126] "RT @DeepLearn007: 5 Tech Forces That Will Change Insurance for Good\n#AI #MachineLearning #fintech #insurtech #ML #tech \nhttps://t.co/W7tNl3Â…"
# we create a list to store user names
who_retweet = as.list(1:length(rt_patterns))
who_post = as.list(1:length(rt_patterns))
# for loop
for (i in 1:length(rt_patterns))
{
# get tweet with retweet entity
twit = tweets[[rt_patterns[i]]]
# get retweet source
poster = str_extract_all(twit$getText(),"(RT|via)((?:\\b\\W*@\\w+)+)")
#remove ':'
poster = gsub(":", "", unlist(poster))
# name of retweeted user
who_post[[i]] = gsub("(RT @|via @)", "", poster, ignore.case=TRUE)
# name of retweeting user
who_retweet[[i]] = rep(twit$getScreenName(), length(poster))
}
# and we put it off the list
who_post = unlist(who_post)
who_retweet = unlist(who_retweet)
# two column matrix of edges
retweeter_poster = cbind(who_retweet, who_post)
# generate graph
rt_graph = graph.edgelist(retweeter_poster)
# get vertex names
ver_labs = get.vertex.attribute(rt_graph, "name", index=V(rt_graph))
# choose some layout
glay = layout_with_kk(rt_graph)
# plot
par(bg="white", mar=c(1,1,1,1))
plot(rt_graph, layout=glay,
vertex.color="black",
vertex.size=10,
vertex.label=ver_labs,
vertex.label.family="sans",
vertex.shape="none",
vertex.label.color=hsv(h=.165, s=.28, v=.08, alpha=1),
vertex.label.cex=0.85,
edge.arrow.size=0.8,
edge.arrow.width=0.5,
edge.width=3,
edge.color=hsv(h=0, s=1, v=1, alpha=1))
# edge.color=("#408080")
# add title
title("nTweets on #MachineLearning : Who retweets whom",
cex.main=1, col.main="black")
# for loop
for (i in 1:3)
{
# get tweet with retweet entity
twit = tweets[[rt_patterns[i]]]
# get retweet source
poster = str_extract_all(twit$getText(),"(RT|via)((?:\\b\\W*@\\w+)+)")
#remove ':'
poster = gsub(":", "", unlist(poster))
# name of retweeted user
who_post[[i]] = gsub("(RT @|via @)", "", poster, ignore.case=TRUE)
# name of retweeting user
who_retweet[[i]] = rep(twit$getScreenName(), length(poster))
}
# and we put it off the list
who_post = unlist(who_post)
who_retweet = unlist(who_retweet)
# two column matrix of edges
retweeter_poster = cbind(who_retweet, who_post)
# generate graph
rt_graph = graph.edgelist(retweeter_poster)
# get vertex names
ver_labs = get.vertex.attribute(rt_graph, "name", index=V(rt_graph))
# choose some layout
glay = layout_with_fr(rt_graph)
# plot
par(bg="white", mar=c(1,1,1,1))
plot(rt_graph, layout=glay,
vertex.color="black",
vertex.size=10,
vertex.label=ver_labs,
vertex.label.family="sans",
vertex.shape="none",
vertex.label.color=hsv(h=.165, s=.28, v=.08, alpha=1),
vertex.label.cex=0.85,
edge.arrow.size=0.8,
edge.arrow.width=0.5,
edge.width=3,
edge.color=hsv(h=0, s=1, v=1, alpha=1))
# edge.color=("#408080")
# add title
title("nTweets on #MachineLearning : Who retweets whom",
cex.main=1, col.main="black")
Social Network Analysis
Focusing on relationships among social entities, social network analysis is used widely in the social and behavioral sciences, economics, marketing and industrial engineering. Retweets of a Tweet shows the information flow occurance in today’s information age. Product List, Product Review, and Technology Trends, just named a few research benifit you may get by study the retweet trend.