<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/analysing-ios-app-store-itunes-reviews-in-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://datascienceplus.com/analysing-ios-app-store-itunes-reviews-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>Unlike Google PlayStore Developer Console for Android App, iOS App Store’s iTunes Connect does not help developers with the bulk download of App Store iTunes Reviews. So if you are an iOS App Developer or a Mobile App Product Manager, You are left with no option but to get paid subscription like App Annie to access and analyze iOS App Store iTunes Reviews of your App. </p>
<p><code>itunesr</code> an R package to access and analyse iOS App Store iTunes Reviews and We will see how to use <code>itunesr</code> to analyse iTunes Reviews of any iOS App <em>for free</em>. </p>
<h2>Installation &amp; Loading:</h2>
<p><code>itunesr</code> can be directly installed from <a rel="nofollow" href="https://cran.r-project.org/web/packages/itunesr/index.html" target="_blank">CRAN</a> or the development version <a rel="nofollow" href="https://github.com/amrrs/itunesr" target="_blank">from Github</a>. </p>
<pre>
# install itunesr directly from CRAN:
install.packages(&quot;itunesr&quot;)

#  the development version from GitHub:
# install.packages(&quot;devtools&quot;)
devtools::install_github(&quot;amrrs/itunesr&quot;)

library(itunesr)
</pre>
<h2>Reviews Extraction:</h2>
<p>To access reviews of any iOS App, We need to have the App Id. The App ID of an iOS App ID could be found in its iTunes URL (Link). Below is the screenshot showing how to identify the App ID of <code>Uber</code> iOS App.</p>
<p><a rel="nofollow" href="https://i2.wp.com/datascienceplus.com/wp-content/uploads/2017/11/uber_ios_app.png?ssl=1" target="_blank"><img sizes="(max-width: 832px) 100vw, 832px" src="https://i2.wp.com/datascienceplus.com/wp-content/uploads/2017/11/uber_ios_app.png?w=450&ssl=1" alt="" class="wp-image-9694" data-recalc-dims="1"></a></p>
<p>Now we have got the App ID – <code>368677368</code> for which we are going to access iTunes Reviews and analyse it. </p>
<p>We can extract iTunes Reviews of any app with `getReviews()` function which takes 3 arguments – 1. App ID, 2. Country Code, 3. Recency / Reviews Page Data . Let us extract the reviews of Uber iOS App.</p>
<pre>
#Latest (Page 1) Uber Reviews for the Country: US
uber_reviews &lt;- getReviews(368677368,'us',1)
</pre>
<p>As mentioned above, <code>getReviews</code> extracts most recent <strong>50 reviews ~ 1st page </strong> from <strong>US</strong> App Store for <strong>Uber</strong> App and stores the information in <code>uber_reviews</code> as a dataframe.</p>
<p>Following are the attributes of Reviews that are extracted using <code>getReviews</code>:</p>
<pre>
#Displaying the column names 
names(uber_reviews)
<em>[1] &quot;Title&quot; &quot;Author_URL&quot; &quot;Author_Name&quot; &quot;App_Version&quot; &quot;Rating&quot; &quot;Review&quot; &quot;Date&quot; </em>
</pre>
<h2>Ratings Trend:</h2>
<p>Let us trend the Average Ratings for the Reviews received for each day. We will use <code>highcharter</code> package for an interactive plot of this Average Rating Trend. </p>
<pre>
#Ratings Trend
library(highcharter)
library(dplyr)
library(lubridate)
dt &lt;- uber_reviews
dt$Date &lt;- as.Date(dt$Date)
dt$Rating &lt;- as.numeric(dt$Rating)    
dt &lt;- dt %>% select(Date,Rating) %>% group_by(Date) %>% summarise(Rating = round(mean(Rating),2))
highchart() %>%   hc_add_series_times_values(dt$Date,dt$Rating, name = 'Average Rating')
</pre>
<p>Gives this interactive plot:<br>
<a rel="nofollow" href="https://i0.wp.com/datascienceplus.com/wp-content/uploads/2017/11/average_rating_trend.png?ssl=1" target="_blank"><img sizes="(max-width: 490px) 100vw, 490px" src="https://i1.wp.com/datascienceplus.com/wp-content/uploads/2017/11/average_rating_trend-490x433.png?w=450&ssl=1" alt="" class="wp-image-9696" data-recalc-dims="1"></a></p>
<h2>Sentiment Analysis of Reviews:</h2>
<p>Having trended Average Rating over Days, Let us implement the most obvious Text Analytics implementation – <a rel="nofollow" href="https://datascienceplus.com/handling-happy-vs-not-happy-better-sentiment-analysis-with-sentimentr-in-r/" target="_blank">Sentiment Analysis</a>. </p>
<pre>
#Sentiment Analysis 
library(sentimentr)
reviews_only &lt;- as.character(uber_reviews$Review)
sentiment_scores &lt;- reviews_only %>% sentiment_by(by=NULL)
highchart() %>% hc_xAxis(sentiment_scores$element_id) %>% hc_add_series(sentiment_scores$ave_sentiment, name = 'Reviews Sentiment Scores')
</pre>
<p>Gives this plot:<br>
<a rel="nofollow" href="https://i2.wp.com/datascienceplus.com/wp-content/uploads/2017/11/sentiment_scores_uber.png?ssl=1" target="_blank"><img sizes="(max-width: 703px) 100vw, 703px" src="https://i2.wp.com/datascienceplus.com/wp-content/uploads/2017/11/sentiment_scores_uber.png?w=450&ssl=1" alt="" class="wp-image-9697" data-recalc-dims="1"></a></p>
<p>With that, We have accessed iTunes Reviews of Uber iOS App, performed a basic exploratory analysis and sentiment analysis of the reviews verbatim. This is more than what the paid version of App Annie or similar tool can offer, but can be done for free with R using <code>itunesr</code> package. The code and plots used in this post are available on <a rel="nofollow" href="https://github.com/amrrs/analysing_itunes_reviews/" target="_blank">my github</a>.</p>
<p><b>References:</b></p>
<ul>1. <a rel="nofollow" href="https://itunes.apple.com/us/app/uber/id368677368?mt=8" target="_blank">Uber iTunes App Store URL </a><br>
2. <a rel="nofollow" href="https://cran.r-project.org/web/packages/itunesr/index.html" target="_blank">itunesr CRAN Package</a><br>
3. <a rel="nofollow" href="https://github.com/amrrs/itunesr" target="_blank">itunes Github Development Version</a><br>
4. <a rel="nofollow" href="https://github.com/amrrs/analysing_itunes_reviews" target="_blank">Code and Plots used here</a></ul>
<ul></ul>
<p><strong>
<p>Related Post</p>
<p></p></strong>
<ol>
<li><a rel="nofollow" href="https://datascienceplus.com/handling-happy-vs-not-happy-better-sentiment-analysis-with-sentimentr-in-r/" title="Permanent Link toHandling ‘Happy’ vs ‘Not Happy’: Better sentiment analysis with sentimentr in R" target="_blank">Handling ‘Happy’ vs ‘Not Happy’: Better sentiment analysis with sentimentr in R</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/creating-reporting-template-with-glue-in-r/" title="Permanent Link toCreating Reporting Template with Glue in R" target="_blank">Creating Reporting Template with Glue in R</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/predict-employee-turnover-with-python/" title="Permanent Link toPredict Employee Turnover With Python" target="_blank">Predict Employee Turnover With Python</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/making-a-shiny-dashboard-using-highcharter-analyzing-inflation-rates/" title="Permanent Link toMaking a Shiny dashboard using ‘highcharter’ – Analyzing Inflation Rates" target="_blank">Making a Shiny dashboard using ‘highcharter’ – Analyzing Inflation Rates</a></li>
<li><a rel="nofollow" href="https://datascienceplus.com/time-series-analysis-in-r-part-2-time-series-transformations/" title="Permanent Link toTime Series Analysis in R Part 2: Time Series Transformations" target="_blank">Time Series Analysis in R Part 2: Time Series Transformations</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/analysing-ios-app-store-itunes-reviews-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/u7jrxZ_3S3Y" height="1"></a></div>