setwd("C:/Users/YUSUF SULTAN/AppData/Roaming/SPB_Data")
kickstart <- read.csv("kickstart.csv", header = TRUE, stringsAsFactors = FALSE)
str(kickstart)
## 'data.frame': 13 obs. of 7 variables:
## $ Crowdfunded : chr "Games" "Film & Video" "Design" "Music" ...
## $ Launched : int 2796 9600 1882 9086 831 5634 1828 3783 1170 1787 ...
## $ Successful : int 911 3891 759 5067 312 1666 688 1837 542 1194 ...
## $ Money.pledged : int 83144565 57951876 50124041 34953600 29003932 15311251 11117486 10477939 9242233 7084968 ...
## $ Pledges : int 1378143 647361 536469 522441 270912 262738 138204 155782 177070 95225 ...
## $ Success.rate : num 32.6 40.5 40.3 55.8 37.5 29.6 37.6 48.6 46.3 66.8 ...
## $ Average.pledge: num 60.3 89.5 93.4 66.9 107.1 ...
library(ggthemes)
library(scales)
library(ggplot2)
CrowdfundedProjects <-ggplot(kickstart,aes(Launched , Money.pledged/1000000))+
geom_point(aes(colour = Average.pledge , size = Success.rate)) +
facet_wrap(~Crowdfunded)+
theme(axis.text.x=element_text(color = "black",angle = 90, hjust = 1, face="bold"),axis.text.y=element_text(color = "black", face="bold"), panel.background = element_rect(fill = "#F5D0A9", color = "black"), plot.background = element_rect(fill = "#F7BE81", color = "black"))+
scale_y_continuous(breaks = c(0, 20, 40,60,80))+
scale_x_continuous(breaks = c(0,2000,4000, 6000, 8000),label=dollar_format())+
scale_color_continuous(label=dollar_format())
CrowdfundedProjects+labs(title = "Crowdfunded Projects on Kickstarter in 2012" ,x = "Crowdfunded Launched",y = "Money.pledged in Million($)", size = "Success.Rate (%)", color = "Average.pledge ($)", face="bold",subtitle = "Source :Company reports, based on First version of the visulization",caption = "(*Fully funded projects as % of all projects)")
Notes:
I didn’t know how to add one more scale to the graph so we can have 3 legends instead of 2.
Used the scale package helps a lot with the plotting.
Using faceting give us the power to display quantitative information.
Our data did not include discrete variables am wondering if we will have that next assignment.