This project utilizes the Google Play Store Apps dataset, which comprises web-scraped data from 10,000 Play Store apps, offering insights into the Android market. The dataset encompasses information on 10,841 apps, each with 13 attributes such as category, rating, size, and more.
Analyzing this dataset facilitates a deeper understanding of potential patterns within the vast commercial landscape of the Google App Store, providing valuable insights for developers and business operators. Especially noteworthy are the factors influencing rating and price.
df <- read.csv('googleplaystore.csv')
head(df)
## App Category Rating
## 1 Photo Editor & Candy Camera & Grid & ScrapBook ART_AND_DESIGN 4.1
## 2 Coloring book moana ART_AND_DESIGN 3.9
## 3 U Launcher Lite – FREE Live Cool Themes, Hide Apps ART_AND_DESIGN 4.7
## 4 Sketch - Draw & Paint ART_AND_DESIGN 4.5
## 5 Pixel Draw - Number Art Coloring Book ART_AND_DESIGN 4.3
## 6 Paper flowers instructions ART_AND_DESIGN 4.4
## Reviews Size Installs Type Price Content.Rating Genres
## 1 159 19M 10,000+ Free 0 Everyone Art & Design
## 2 967 14M 500,000+ Free 0 Everyone Art & Design;Pretend Play
## 3 87510 8.7M 5,000,000+ Free 0 Everyone Art & Design
## 4 215644 25M 50,000,000+ Free 0 Teen Art & Design
## 5 967 2.8M 100,000+ Free 0 Everyone Art & Design;Creativity
## 6 167 5.6M 50,000+ Free 0 Everyone Art & Design
## Last.Updated Current.Ver Android.Ver
## 1 January 7, 2018 1.0.0 4.0.3 and up
## 2 January 15, 2018 2.0.0 4.0.3 and up
## 3 August 1, 2018 1.2.4 4.0.3 and up
## 4 June 8, 2018 Varies with device 4.2 and up
## 5 June 20, 2018 1.1 4.4 and up
## 6 March 26, 2017 1.0 2.3 and up
Remove the rows with null values.
df$Size[df$Size == "Varies with device"] <- NA
df[df== ""] <- NA
colSums(is.na(df))
## App Category Rating Reviews Size
## 0 0 1474 0 1695
## Installs Type Price Content.Rating Genres
## 0 0 0 1 0
## Last.Updated Current.Ver Android.Ver
## 0 1 1
df <- na.omit(df)
Convert the app size from string to float.
head(df$Size, 3)
## [1] "19M" "14M" "8.7M"
df$Size <- as.numeric(gsub("[,MKmk]", "", df$Size))
head(df$Size, 3)
## [1] 19.0 14.0 8.7
Convert the count of installs from string to numeric
head(df$Installs, 3)
## [1] "10,000+" "500,000+" "5,000,000+"
df$Installs <- as.numeric(gsub("[,+]", "", df$Installs))
head(df$Installs, 3)
## [1] 1e+04 5e+05 5e+06
Convert Reviews and Price to numeric
df$Reviews <- as.numeric(df$Reviews)
df$Price <- as.numeric(gsub("[,+$freeEveryone]", "", df$Price))
Check outliers
library(ggplot2)
## Warning: 程辑包'ggplot2'是用R版本4.2.3 来建造的
ggplot(df, aes(x = "", y = Size)) + geom_boxplot() + labs(title = "Size")
ggplot(df, aes(x = "", y = Installs)) + geom_boxplot() + labs(title = "Installs")
ggplot(df, aes(x = "", y = Reviews)) + geom_boxplot() + labs(title = "Reviews")
The distributions of these variables are normal and there are no outliers.
Show the data types of all variables.
str(df)
## 'data.frame': 7728 obs. of 13 variables:
## $ App : chr "Photo Editor & Candy Camera & Grid & ScrapBook" "Coloring book moana" "U Launcher Lite – FREE Live Cool Themes, Hide Apps" "Sketch - Draw & Paint" ...
## $ Category : chr "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" ...
## $ Rating : num 4.1 3.9 4.7 4.5 4.3 4.4 3.8 4.1 4.4 4.7 ...
## $ Reviews : num 159 967 87510 215644 967 ...
## $ Size : num 19 14 8.7 25 2.8 5.6 19 29 33 3.1 ...
## $ Installs : num 1e+04 5e+05 5e+06 5e+07 1e+05 5e+04 5e+04 1e+06 1e+06 1e+04 ...
## $ Type : chr "Free" "Free" "Free" "Free" ...
## $ Price : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Content.Rating: chr "Everyone" "Everyone" "Everyone" "Teen" ...
## $ Genres : chr "Art & Design" "Art & Design;Pretend Play" "Art & Design" "Art & Design" ...
## $ Last.Updated : chr "January 7, 2018" "January 15, 2018" "August 1, 2018" "June 8, 2018" ...
## $ Current.Ver : chr "1.0.0" "2.0.0" "1.2.4" "Varies with device" ...
## $ Android.Ver : chr "4.0.3 and up" "4.0.3 and up" "4.0.3 and up" "4.2 and up" ...
## - attr(*, "na.action")= 'omit' Named int [1:3113] 24 38 43 53 68 69 74 86 89 90 ...
## ..- attr(*, "names")= chr [1:3113] "24" "38" "43" "53" ...
Only 5 variables are numeric, and the rest are characters.
summary(df)
## App Category Rating Reviews
## Length:7728 Length:7728 Min. :1.000 Min. : 1
## Class :character Class :character 1st Qu.:4.000 1st Qu.: 108
## Mode :character Mode :character Median :4.300 Median : 2324
## Mean :4.174 Mean : 294708
## 3rd Qu.:4.500 3rd Qu.: 38980
## Max. :5.000 Max. :44893888
## Size Installs Type Price
## Min. : 1.00 Min. :1.000e+00 Length:7728 Min. : 0.000
## 1st Qu.: 6.10 1st Qu.:1.000e+04 Class :character 1st Qu.: 0.000
## Median : 16.00 Median :1.000e+05 Mode :character Median : 0.000
## Mean : 37.29 Mean :8.419e+06 Mean : 1.128
## 3rd Qu.: 37.00 3rd Qu.:1.000e+06 3rd Qu.: 0.000
## Max. :994.00 Max. :1.000e+09 Max. :400.000
## Content.Rating Genres Last.Updated Current.Ver
## Length:7728 Length:7728 Length:7728 Length:7728
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Android.Ver
## Length:7728
## Class :character
## Mode :character
##
##
##
Show the count of unique values of each non-numeric variable.
chr_unique_counts <- sapply(df, function(x) {
if (is.character(x)) {
length(unique(x))
} else {
NA
}
})
chr_unique_counts <- chr_unique_counts[!is.na(chr_unique_counts)]
print(chr_unique_counts)
## App Category Type Content.Rating Genres
## 7028 33 2 6 112
## Last.Updated Current.Ver Android.Ver
## 1278 2520 32
The number of unique values for each variable varies significantly, ranging from 2 to 7028.
Create a new columns ‘Paid’, which is the label encoding of the ordinal variable Type.
df$Paid <- as.numeric(as.factor(df$Type)) - 1
unique(df$Paid)
## [1] 0 1
Convert some variables to factors
head(df)
## App Category Rating
## 1 Photo Editor & Candy Camera & Grid & ScrapBook ART_AND_DESIGN 4.1
## 2 Coloring book moana ART_AND_DESIGN 3.9
## 3 U Launcher Lite – FREE Live Cool Themes, Hide Apps ART_AND_DESIGN 4.7
## 4 Sketch - Draw & Paint ART_AND_DESIGN 4.5
## 5 Pixel Draw - Number Art Coloring Book ART_AND_DESIGN 4.3
## 6 Paper flowers instructions ART_AND_DESIGN 4.4
## Reviews Size Installs Type Price Content.Rating Genres
## 1 159 19.0 1e+04 Free 0 Everyone Art & Design
## 2 967 14.0 5e+05 Free 0 Everyone Art & Design;Pretend Play
## 3 87510 8.7 5e+06 Free 0 Everyone Art & Design
## 4 215644 25.0 5e+07 Free 0 Teen Art & Design
## 5 967 2.8 1e+05 Free 0 Everyone Art & Design;Creativity
## 6 167 5.6 5e+04 Free 0 Everyone Art & Design
## Last.Updated Current.Ver Android.Ver Paid
## 1 January 7, 2018 1.0.0 4.0.3 and up 0
## 2 January 15, 2018 2.0.0 4.0.3 and up 0
## 3 August 1, 2018 1.2.4 4.0.3 and up 0
## 4 June 8, 2018 Varies with device 4.2 and up 0
## 5 June 20, 2018 1.1 4.4 and up 0
## 6 March 26, 2017 1.0 2.3 and up 0
df$Content.Rating = as.factor(df$Content.Rating)
df$Genres = as.factor(df$Genres)
df$Category = as.factor(df$Category)
Perform log transformations
head(df)
## App Category Rating
## 1 Photo Editor & Candy Camera & Grid & ScrapBook ART_AND_DESIGN 4.1
## 2 Coloring book moana ART_AND_DESIGN 3.9
## 3 U Launcher Lite – FREE Live Cool Themes, Hide Apps ART_AND_DESIGN 4.7
## 4 Sketch - Draw & Paint ART_AND_DESIGN 4.5
## 5 Pixel Draw - Number Art Coloring Book ART_AND_DESIGN 4.3
## 6 Paper flowers instructions ART_AND_DESIGN 4.4
## Reviews Size Installs Type Price Content.Rating Genres
## 1 159 19.0 1e+04 Free 0 Everyone Art & Design
## 2 967 14.0 5e+05 Free 0 Everyone Art & Design;Pretend Play
## 3 87510 8.7 5e+06 Free 0 Everyone Art & Design
## 4 215644 25.0 5e+07 Free 0 Teen Art & Design
## 5 967 2.8 1e+05 Free 0 Everyone Art & Design;Creativity
## 6 167 5.6 5e+04 Free 0 Everyone Art & Design
## Last.Updated Current.Ver Android.Ver Paid
## 1 January 7, 2018 1.0.0 4.0.3 and up 0
## 2 January 15, 2018 2.0.0 4.0.3 and up 0
## 3 August 1, 2018 1.2.4 4.0.3 and up 0
## 4 June 8, 2018 Varies with device 4.2 and up 0
## 5 June 20, 2018 1.1 4.4 and up 0
## 6 March 26, 2017 1.0 2.3 and up 0
df$log_Reviews <- log(df$Reviews + 1)
df$log_Installs <- log(df$Installs + 1)
library(dplyr)
## Warning: 程辑包'dplyr'是用R版本4.2.3 来建造的
##
## 载入程辑包:'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
numerical_vars <- df %>%
select_if(is.numeric)
summary(numerical_vars)
## Rating Reviews Size Installs
## Min. :1.000 Min. : 1 Min. : 1.00 Min. :1.000e+00
## 1st Qu.:4.000 1st Qu.: 108 1st Qu.: 6.10 1st Qu.:1.000e+04
## Median :4.300 Median : 2324 Median : 16.00 Median :1.000e+05
## Mean :4.174 Mean : 294708 Mean : 37.29 Mean :8.419e+06
## 3rd Qu.:4.500 3rd Qu.: 38980 3rd Qu.: 37.00 3rd Qu.:1.000e+06
## Max. :5.000 Max. :44893888 Max. :994.00 Max. :1.000e+09
## Price Paid log_Reviews log_Installs
## Min. : 0.000 Min. :0.00000 Min. : 0.6931 Min. : 0.6931
## 1st Qu.: 0.000 1st Qu.:0.00000 1st Qu.: 4.6890 1st Qu.: 9.2104
## Median : 0.000 Median :0.00000 Median : 7.7513 Median :11.5129
## Mean : 1.128 Mean :0.07492 Mean : 7.7157 Mean :11.6514
## 3rd Qu.: 0.000 3rd Qu.:0.00000 3rd Qu.:10.5708 3rd Qu.:13.8155
## Max. :400.000 Max. :1.00000 Max. :17.6198 Max. :20.7233
library(GGally)
## Warning: 程辑包'GGally'是用R版本4.2.3 来建造的
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
numerical_vars <- df[, sapply(df, is.numeric)]
pairs(numerical_vars)
numerical_vars <- df %>%
select_if(is.numeric)
correlations <- cor(numerical_vars)
library(corrplot)
## Warning: 程辑包'corrplot'是用R版本4.2.3 来建造的
## corrplot 0.92 loaded
corrplot(correlations, method="color", tl.srt=45)
From the pair plot and the correlation matrix, it appears that there may be certain patterns among certain variables. For instance, there is a relatively high correlation between ‘Installs’ and ‘Reviews,’ which aligns with our common understanding. Additionally, concerning the ‘Rating’ variable, the highest correlation is observed with the logarithm of ’Reviews.
category_counts <- sort(table(df$Category), decreasing = TRUE)
category_counts <- as.data.frame(category_counts)
colnames(category_counts)[1] <- "Category"
ggplot(data = category_counts, aes(x = "", y = Freq, fill = Category)) +
geom_bar(stat = "identity", width = 1, color = "white") +
coord_polar("y", start = 0) +
theme_void() +
labs(title = "Category Distribution")
Among all categories, FAMILY and GAME collectively dominate the market, accounting for the highest share. The combined proportion of the top six categories exceeds 50%.
ggplot(df, aes(x = Rating)) + geom_density(fill = "green", alpha = 0.6) +
labs(title = "Density Plot of Rating", x = "Rating", y = "Density")
ggplot(df, aes(x = Category, y = Rating)) +
geom_boxplot() +
theme_void() +
labs(title = "App Ratings Distribution") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
library(dplyr)
avg_rating <- df %>%
group_by(Category) %>%
summarize(Avg_Rating = mean(Rating, na.rm = TRUE)) %>%
arrange(desc(Avg_Rating))
print(avg_rating)
## # A tibble: 33 × 2
## Category Avg_Rating
## <fct> <dbl>
## 1 EVENTS 4.48
## 2 EDUCATION 4.39
## 3 ART_AND_DESIGN 4.36
## 4 PARENTING 4.35
## 5 PERSONALIZATION 4.32
## 6 BOOKS_AND_REFERENCE 4.32
## 7 BEAUTY 4.29
## 8 GAME 4.27
## 9 SOCIAL 4.26
## 10 WEATHER 4.24
## # ℹ 23 more rows
The distribution of ratings is skewed, with the highest probability
density around 4.3. There are variations in ratings across different
categories, and the ‘EVENTS’ category stands out with the highest
average rating at 4.47.
5) Can the size of an app be managed, and does the app’s size have an
influence on its rating
ggplot(df, aes(x = Size, y = Rating)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", se = TRUE, color = "blue") +
labs(title = "Scatter Plot of Rating and Size", x = "Size", y = "Rating")
## `geom_smooth()` using formula = 'y ~ x'
From the graph, it can be observed that size has a slight impact on rating. Smaller-sized apps tend to have slightly higher ratings. However, it’s worth noting that many larger-sized apps also achieve high ratings.
ggplot(df, aes(x = log(Price))) + geom_density(fill = "green", alpha = 0.6) +
labs(title = "Density Plot of Price", x = "Price(log)", y = "Density")
## Warning: Removed 7149 rows containing non-finite values (`stat_density()`).
The majority of apps are free, but there are also a few highly-priced apps.
top_categories <- df %>%
group_by(Category) %>%
summarize(Avg_Price = mean(Price), na.rm = TRUE) %>%
top_n(7, Avg_Price) %>%
arrange(desc(Avg_Price))
filtered_data <- df %>%
filter(Category %in% top_categories$Category)
ggplot(filtered_data, aes(x = Category, y = log(Price))) +
geom_violin() +
labs(title = "Violin Plot of Top 7 Categories by Avg Price (log)", x = "Category", y = "Price (log)") +
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))
## Warning: Removed 2711 rows containing non-finite values (`stat_ydensity()`).
As depicted in the above graph, categories such as ‘Family’ and ‘Finance’ exhibit the highest average prices, suggesting that apps in these categories may adopt a premium pricing strategy.
ggplot(df, aes(x = Type, y = log_Installs)) +
geom_boxplot() +
labs(title = "Boxplot of Downloads and Reviews for Paid Apps", x = "Type", y = "Downloads")
ggplot(df, aes(x = Type, y = Rating)) +
geom_boxplot() +
labs(title = "Boxplot of Downloads and Reviews for Paid Apps", x = "Type", y = "Downloads")
The download count for free apps significantly surpasses that of paid apps, yet paid apps tend to receive higher ratings.
1). There may be certain patterns among certain variables. For instance, there is a relatively high correlation between ‘Installs’ and ‘Reviews,’ which aligns with our common understanding. Additionally, concerning the ‘Rating’ variable, the highest correlation is observed with the logarithm of ’Reviews.
2). Among all categories, FAMILY and GAME collectively dominate the market, accounting for the highest share. The combined proportion of the top six categories exceeds 50%.
3). The distribution of ratings is skewed, with the highest probability density around 4.3. There are variations in ratings across different categories, and the ‘EVENTS’ category stands out with the highest average rating at 4.47.
4). Size has a slight impact on rating. Smaller-sized apps tend to have slightly higher ratings. However, it’s worth noting that many larger-sized apps also achieve high ratings.
5). The majority of apps are free, but categories such as ‘Family’ and ‘Finance’ exhibit the highest average prices, suggesting that apps in these categories may adopt a premium pricing strategy.
6). The download count for free apps significantly surpasses that of paid apps, yet paid apps tend to receive higher ratings.