<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/5-interesting-subtle-insights-from-ted-videos-data-analysis-in-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://datascienceplus.com/5-interesting-subtle-insights-from-ted-videos-data-analysis-in-r/"> R Programming – DataScience+</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>This post aims to bring out some not-so-obvious subtle insights from analyzing TED Videos posted on <a rel="nofollow" href="https://www.ted.com/" target="_blank">TED.com</a>. For those who do not know what is TED, Here’s the summary from <a rel="nofollow" href="https://en.wikipedia.org/wiki/TED_(conference)" target="_blank">Wikipedia</a>: TED (Technology, Entertainment, Design) is a media organization which posts talks online for free distribution, under the slogan “ideas worth spreading”.</p>
<p>This analysis uses <a rel="nofollow" href="https://www.kaggle.com/rounakbanik/ted-talks" target="_blank">TED Talks dataset</a> posted on Kaggle Datasets. </p>
<h3>Data Description</h3>
<p>Once the data is downloaded from the above link and unzipped, two files – 1. transcripts.csv, 2. ted_main.csv that are found to be read into R as below:</p>
<pre>
transcripts &lt;- read.csv('../transcripts.csv',stringsAsFactors=F, header = T)
main &lt;- read.csv('../ted_main.csv',stringsAsFactors=F, header = T)
</pre>
<p><code>ted_main.csv</code> contains informations like Speaker Name, Talk Name, Event Name, Talk Duration, Comments, Video Views and much more for the videos made available on TED and <code>transcripts.csv</code> contains the entire talk transcript of the same talks. </p>
<p><b>Loading Libraries</b></p>
<pre>
library(dplyr); library(ggplot2); library(ggthemes);
</pre>
<p>Extract some basic info regarding the dataset. </p>
<pre>
nrow(main)
<em>2550
</em>
</pre>
<p>2550 Video details are available in the <i>main</i> data frame. Since not all TED videos are extremely popular, let us see how many of those are with more than 1M views.</p>
<pre>
paste0('Total Number of videos with more than 1M views: ',main %>% filter(views > 1000000) %>% count() )
paste0('% of videos with more than 1M views: ', round((main %>% filter(views > 1000000) %>% count() / nrow(main))*100,2),'%')

<em>
'Total Number of videos with more than 1M views: 1503'
'% of videos with more than 1M views: 58.94%'
</em>
</pre>
<p>Being a one-trick-Pony is very easy in any business, so let us explore who are those among best of not-so-one-trick-ponies.</p>
<pre>
main %>% filter(views > 1000000) %>% 
group_by(main_speaker) %>% 
count() %>% 
filter(n >2) %>% 
arrange(desc(n)) %>% 
head(20) %>% 
ggplot() + geom_bar(aes(reorder(main_speaker,-n),n),stat='identity') + theme_solarized() + 
theme(axis.text.x = element_text(angle = 90, hjust = 1)) + xlab('Speakers') + 
ggtitle('To 20 Frequently Appeared Speakers in all videos with 1M+ views')
</pre>
<p>Gives this plot:<br>
<a rel="nofollow" href="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_20_freq_appeared_speakers_ted_com.png?ssl=1" target="_blank"><img sizes="(max-width: 840px) 100vw, 840px" src="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_20_freq_appeared_speakers_ted_com.png?w=450&ssl=1" alt="" class="wp-image-10053" data-recalc-dims="1"></a></p>
<p>And the winner is none other than Mr. <a rel="nofollow" href="https://www.ted.com/speakers/hans_rosling" target="_blank">Hans Rosling</a> whose <a rel="nofollow" href="https://www.ted.com/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen" target="_blank">Gapminder TED talk</a> is always an inspiration for any Data Wiz. </p>
<p>Many a time, the amount of effort put gets translated to the effectiveness of the outcome, but the best is always getting things done with less effort – which in our case, more views with less time. </p>
<pre>
main %>% filter(views > 1000000) %>% arrange(duration) %>% slice(1:10) %>% select('name','duration','views','event')
<em>name	duration	views	event
Derek Sivers: Weird, or just different?	162	2835976	TEDIndia 2009
Paolo Cardini: Forget multitasking, try monotasking	172	2324212	TEDGlobal 2012
Mitchell Joachim: Don't build your home, grow it!	176	1332785	TED2010
Arthur Benjamin: Teach statistics before calculus!	178	2175141	TED2009
Terry Moore: How to tie your shoes	179	6263759	TED2005
Malcolm London: &quot;High School Training Ground&quot;	180	1188177	TED Talks Education
Bobby McFerrin: Watch me play ... the audience!	184	3302312	World Science Festival
Derek Sivers: How to start a movement	189	6475731	TED2010
Bruno Maisonnier: Dance, tiny robots!	189	1193896	TEDxConcorde
Dean Ornish: Your genes are not your fate	192	1384333	TED2008
</em>
</pre>
<p>And the winner this time is, <b><a rel="nofollow" href="https://www.ted.com/speakers/derek_sivers" target="_blank">Derek Sivers</a></b>, who happened to appear twice on the same list, donning two popular TED talks that are just under 6 minutes. </p>
<p>Malcolm Gladwell in his book Outliers presents an interesting case of how Date of Birth plays a role in Hockey team selection, so let us see if there is any magical first letter of the name that stands out among TED Speakers.</p>
<pre>
main$first_letter &lt;- substr(main$main_speaker,1,1)
main %>% 
group_by(first_letter = toupper(first_letter)) %>% 
count() %>% 
arrange(desc(n)) %>% 
ggplot() + 
geom_bar(aes(reorder(first_letter,-n),n),stat = 'identity') + theme_solarized() + 
xlab('Speaker First Letter') +
ylab('Count') + 
ggtitle('Popular First Letter of Author Names appearing in TED Talks')
</pre>
<p>Gives this plot:<br>
<a rel="nofollow" href="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_first_letters_speakers_ted_com.png?ssl=1" target="_blank"><img sizes="(max-width: 840px) 100vw, 840px" src="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_first_letters_speakers_ted_com.png?w=450&ssl=1" alt="" class="wp-image-10055" data-recalc-dims="1"></a></p>
<p>And ‘J’ is the outstanding winner of the first-letter race that whose name holders frequently appeared on TED talks (Remember, correlation doesn’t mean causation!).</p>
<p>While TED primarily publishes videos from TED Global Event, some great TEDx videos get to feature on TED and let us analyze which TEDx chapter made it big.</p>
<pre>
tedx %>% filter(views > 1000000) %>% 
group_by(event) %>% 
count() %>% 
filter(n >2) %>% 
arrange(desc(n)) %>% 
head(20) %>% 
ggplot() + geom_bar(aes(reorder(event,-n),n),stat='identity') + theme_solarized() + 
theme(axis.text.x = element_text(angle = 90, hjust = 1)) + xlab('TEDx Events') + 
ggtitle('Top 20 TEDx Events that more talks with 1M+ views on TED.com')
</pre>
<p>Gives this plot:<br>
<a rel="nofollow" href="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_tedx_chapters_on_ted_com.png?ssl=1" target="_blank"><img sizes="(max-width: 840px) 100vw, 840px" src="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_tedx_chapters_on_ted_com.png?w=450&ssl=1" alt="" class="wp-image-10056" data-recalc-dims="1"></a></p>
<p>And Finally, let us analyze what is that magical (first) word that TED speakers usually start their talk with.</p>
<pre>
transcripts$first_word &lt;- unlist(lapply(transcripts$transcript, function(x) strsplit(x,&quot; &quot;)[[1]][1]))
transcripts %>% group_by(first_word) %>% count() %>% arrange(desc(n)) %>% head(25) %>%
ggplot() + 
geom_bar(aes(reorder(first_word,-n),n),stat = 'identity') + theme_solarized() + 
xlab('First Word of the Talk') +
ylab('Count') + 
ggtitle('Top First Word of the Talk') + 
theme(axis.text.x = element_text(angle = 60, hjust = 1))
</pre>
<p>Gives this plot:<br>
<a rel="nofollow" href="https://i1.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_first_word_ted_transcript_ted_com.png?ssl=1" target="_blank"><img sizes="(max-width: 840px) 100vw, 840px" src="https://i1.wp.com/datascienceplus.com/wp-content/uploads/2017/12/top_first_word_ted_transcript_ted_com.png?w=450&ssl=1" alt="" class="wp-image-10057" data-recalc-dims="1"></a></p>
<p>And as most humans on the planet, most TED Speakers seem to start with ‘I’ (Narcissism, maybe?) and strangely Chris – the first name of Chris Anderson, the owner of TED appears on the same list too (Gratitude, maybe!).</p>
<p>This dataset still has a lot more interesting – subtle insights to be unveiled. The code used here is available on <a rel="nofollow" href="https://github.com/amrrs/TED-Analysis-in-R" target="_blank">my Github</a>. </p>
<ul></ul>
<p><strong>
<p>Related Post</p>
<p></p></strong>
<ol>
<li><a rel="nofollow" href="https://datascienceplus.com/building-a-simple-sales-revenue-dashboard-with-r-shiny-shinydashboard/" title="Permanent Link toBuilding a simple Sales Revenue Dashboard with R Shiny &amp; ShinyDashboard" target="_blank">Building a simple Sales Revenue Dashboard with R Shiny &amp; ShinyDashboard</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/gender-diversity-analysis-of-data-science-industry-using-kaggle-survey-dataset-in-r/" title="Permanent Link toGender Diversity Analysis of Data Science Industry using Kaggle Survey Dataset in R" target="_blank">Gender Diversity Analysis of Data Science Industry using Kaggle Survey Dataset in R</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/how-happy-is-your-country-visualized/" title="Permanent Link toHow Happy is Your Country? — Happy Planet Index Visualized" target="_blank">How Happy is Your Country? — Happy Planet Index Visualized</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/exploring-clustering-and-mapping-torontos-crimes/" title="Permanent Link toExploring, Clustering, and Mapping Toronto’s Crimes" target="_blank">Exploring, Clustering, and Mapping Toronto’s Crimes</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/spring-budget-2017-circle-visualisation/" title="Permanent Link toSpring Budget 2017: Circle Visualisation" target="_blank">Spring Budget 2017: Circle Visualisation</a></li>
</ol>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://datascienceplus.com/5-interesting-subtle-insights-from-ted-videos-data-analysis-in-r/"> R Programming – DataScience+</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/UHg0fSzguqA" height="1"></a></div>