{"id":20401633,"url":"https://github.com/amrrs/ted-analysis-in-r","last_synced_at":"2026-05-10T18:04:54.127Z","repository":{"id":109459432,"uuid":"114264016","full_name":"amrrs/TED-Analysis-in-R","owner":"amrrs","description":"TED Video Data Analysis in R","archived":false,"fork":false,"pushed_at":"2017-12-20T15:35:14.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T12:01:00.811Z","etag":null,"topics":["r","ted"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amrrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-14T15:05:02.000Z","updated_at":"2017-12-14T15:11:12.000Z","dependencies_parsed_at":"2023-03-13T14:11:19.806Z","dependency_job_id":null,"html_url":"https://github.com/amrrs/TED-Analysis-in-R","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrrs%2FTED-Analysis-in-R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrrs%2FTED-Analysis-in-R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrrs%2FTED-Analysis-in-R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrrs%2FTED-Analysis-in-R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amrrs","download_url":"https://codeload.github.com/amrrs/TED-Analysis-in-R/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241950080,"owners_count":20047587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","ted"],"created_at":"2024-11-15T04:50:54.727Z","updated_at":"2026-05-10T18:04:54.048Z","avatar_url":"https://github.com/amrrs.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Top Misc Things - TED Analysis in R\n\n* DS+ Article: [5 interesting subtle insights from TED videos data analysis in R](https://datascienceplus.com/5-interesting-subtle-insights-from-ted-videos-data-analysis-in-r/)\n\n* Kaggle Kernel: https://www.kaggle.com/nulldata/top-misc-things-ted-analysis-in-r\n\n\n```R\noptions(scipen=999)\n```\n\n\n```R\nlibrary(dplyr); library(ggplot2); library(ggthemes);\n```\n\n\n```R\ntranscripts \u003c- read.csv('../input/transcripts.csv',stringsAsFactors=F, header = T)\nmain \u003c- read.csv('../input/ted_main.csv',stringsAsFactors=F, header = T)\n```\n\n### Total Number of Rows/Entries in the Main Dataset\n\n\n```R\nnrow(main)\n```\n\n\n2550\n\n\n### Entries with more \u003e= 1M views\n\n\n```R\npaste0('Total Number of videos with more than 1M views: ',main %\u003e% filter(views \u003e 1000000) %\u003e% count() )\npaste0('% of videos with more than 1M views: ', round((main %\u003e% filter(views \u003e 1000000) %\u003e% count() / nrow(main))*100,2),'%')\n```\n\n\n'Total Number of videos with more than 1M views: 1503'\n\n\n\n'% of videos with more than 1M views: 58.94%'\n\n\n###  Not so one-trick Pony!\n\n\n```R\nmain %\u003e% filter(views \u003e 1000000) %\u003e% \ngroup_by(main_speaker) %\u003e% \ncount() %\u003e% \nfilter(n \u003e2) %\u003e% \narrange(desc(n)) %\u003e% \nhead(20) %\u003e% \nggplot() + geom_bar(aes(reorder(main_speaker,-n),n),stat='identity') + theme_solarized() + \ntheme(axis.text.x = element_text(angle = 90, hjust = 1)) + xlab('Speakers') + \nggtitle('To 20 Frequently Appeared Speakers in all videos with 1M+ views')\n```\n\n\n\n\n![png](output_8_1.png)\n\n\n### Less Time More Impact \n\n\n```R\nmain %\u003e% filter(views \u003e 1000000) %\u003e% arrange(duration) %\u003e% slice(1:10) %\u003e% select('name','duration','views','event')\n```\n\n\n\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth scope=col\u003ename\u003c/th\u003e\u003cth scope=col\u003eduration\u003c/th\u003e\u003cth scope=col\u003eviews\u003c/th\u003e\u003cth scope=col\u003eevent\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\t\u003ctr\u003e\u003ctd\u003eDerek Sivers: Weird, or just different?            \u003c/td\u003e\u003ctd\u003e162                                                \u003c/td\u003e\u003ctd\u003e2835976                                            \u003c/td\u003e\u003ctd\u003eTEDIndia 2009                                      \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003ePaolo Cardini: Forget multitasking, try monotasking\u003c/td\u003e\u003ctd\u003e172                                                \u003c/td\u003e\u003ctd\u003e2324212                                            \u003c/td\u003e\u003ctd\u003eTEDGlobal 2012                                     \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eMitchell Joachim: Don't build your home, grow it!  \u003c/td\u003e\u003ctd\u003e176                                                \u003c/td\u003e\u003ctd\u003e1332785                                            \u003c/td\u003e\u003ctd\u003eTED2010                                            \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eArthur Benjamin: Teach statistics before calculus! \u003c/td\u003e\u003ctd\u003e178                                                \u003c/td\u003e\u003ctd\u003e2175141                                            \u003c/td\u003e\u003ctd\u003eTED2009                                            \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eTerry Moore: How to tie your shoes                 \u003c/td\u003e\u003ctd\u003e179                                                \u003c/td\u003e\u003ctd\u003e6263759                                            \u003c/td\u003e\u003ctd\u003eTED2005                                            \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eMalcolm London: \"High School Training Ground\"      \u003c/td\u003e\u003ctd\u003e180                                                \u003c/td\u003e\u003ctd\u003e1188177                                            \u003c/td\u003e\u003ctd\u003eTED Talks Education                                \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eBobby McFerrin: Watch me play ... the audience!    \u003c/td\u003e\u003ctd\u003e184                                                \u003c/td\u003e\u003ctd\u003e3302312                                            \u003c/td\u003e\u003ctd\u003eWorld Science Festival                             \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eDerek Sivers: How to start a movement              \u003c/td\u003e\u003ctd\u003e189                                                \u003c/td\u003e\u003ctd\u003e6475731                                            \u003c/td\u003e\u003ctd\u003eTED2010                                            \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eBruno Maisonnier: Dance, tiny robots!              \u003c/td\u003e\u003ctd\u003e189                                                \u003c/td\u003e\u003ctd\u003e1193896                                            \u003c/td\u003e\u003ctd\u003eTEDxConcorde                                       \u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eDean Ornish: Your genes are not your fate          \u003c/td\u003e\u003ctd\u003e192                                                \u003c/td\u003e\u003ctd\u003e1384333                                            \u003c/td\u003e\u003ctd\u003eTED2008                                            \u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\n### Skeeeeewed Views\n\n\n```R\nggplot(main) + geom_histogram(aes(views)) + ggtitle('Histogram of Views') + theme_solarized()\n```\n\n    `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.\n    \n\n\n\n\n![png](output_12_2.png)\n\n\n\n```R\nmain$first_letter \u003c- substr(main$main_speaker,1,1)\n```\n\n### J/S/A - Seems the magical First Letter!\n\n\n```R\nmain %\u003e% \ngroup_by(first_letter = toupper(first_letter)) %\u003e% \ncount() %\u003e% \narrange(desc(n)) %\u003e% \nggplot() + \ngeom_bar(aes(reorder(first_letter,-n),n),stat = 'identity') + theme_solarized() + \nxlab('Speaker First Letter') +\nylab('Count') + \nggtitle('Popular First Letter of Author Names appearing in TED Talks')\n```\n\n\n\n\n![png](output_15_1.png)\n\n\n\n```R\ntedx \u003c- main %\u003e% filter(grepl('tedx',tolower(event)))\n\ntedx %\u003e% count()\n```\n\n\n\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth scope=col\u003en\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\t\u003ctr\u003e\u003ctd\u003e471\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\n### TEDx %in% TED\n\n\n```R\ntedx %\u003e% filter(views \u003e 1000000) %\u003e% \ngroup_by(event) %\u003e% \ncount() %\u003e% \nfilter(n \u003e2) %\u003e% \narrange(desc(n)) %\u003e% \nhead(20) %\u003e% \nggplot() + geom_bar(aes(reorder(event,-n),n),stat='identity') + theme_solarized() + \ntheme(axis.text.x = element_text(angle = 90, hjust = 1)) + xlab('TEDx Events') + \nggtitle('Top 20 TEDx Events that more talks with 1M+ views on TED.com')\n```\n\n\n\n\n![png](output_18_1.png)\n\n\n### Top Comments - Atheism/Schools/Science!\n\n\n```R\nmain %\u003e% \narrange(desc(comments)) %\u003e% \nhead(10) %\u003e% \nggplot() + \ngeom_bar(aes(reorder(title,-comments),comments),stat = 'identity') + theme_solarized() + \nxlab('Talk Name') +\nylab('Count') + \nggtitle('Talks with Most comments') + \ntheme(axis.text.x = element_text(angle = 60, hjust = 1)) \n```\n\n\n\n\n![png](output_20_1.png)\n\n\n\n```R\ntranscripts$first_word \u003c- unlist(lapply(transcripts$transcript, function(x) strsplit(x,\" \")[[1]][1]))\n```\n\n### Narcissim ?\n\n\n```R\ntranscripts %\u003e% group_by(first_word) %\u003e% count() %\u003e% arrange(desc(n)) %\u003e% head(25) %\u003e%\nggplot() + \ngeom_bar(aes(reorder(first_word,-n),n),stat = 'identity') + theme_solarized() + \nxlab('First Word of the Talk') +\nylab('Count') + \nggtitle('Top First Word of the Talk') + \ntheme(axis.text.x = element_text(angle = 60, hjust = 1))\n```\n\n\n\n\n![png](output_23_1.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrrs%2Fted-analysis-in-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrrs%2Fted-analysis-in-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrrs%2Fted-analysis-in-r/lists"}