LOAD LIBRARIES

library(tidyverse)
library(ggplot2)
library(data.table)
library(wordcloud2)

LOAD THE DATA

survey <- fread('C:/Users/ACER PC/Documents/training files/survey_results_public.csv')

COUNTRIES THAT WERE REPRESENTED BY DEVELOPERS

 country <- survey %>%
    filter(!is.na(Country)) %>%
    count(Country,sort=T) 

   wordcloud2(country, shape= 'circle',size = .6)

DEVELOPERS WHO CONSIDER CODING AS A HOBBY

 ggplot(survey,aes(x= factor(Hobby), fill= Hobby)) + geom_bar() + 
    scale_fill_brewer(palette = 'Set1') + theme(legend.position='none') + labs(title='hobby',x=NULL,y=NULL)

DEVELOPERS WHO CONTIBUTE TO THE OPEN SOURCE

 ggplot(survey,aes(x= factor(OpenSource), fill= OpenSource)) + 
    geom_bar() + theme(legend.position='none')  +scale_fill_brewer(palette = 'Set1') + labs(title='open source',x=NULL,y=NULL)

STUDENTS WHO CONTIBUTE TO THE OPEN SOURCE

survey %>%
  ggplot(aes(x= Student,fill= OpenSource)) + geom_bar(position = 'dodge') +
    scale_fill_brewer(palette="Set1") + coord_flip() + theme(legend.position='none') + labs(title='students - contribution',x=NULL,y=NULL)

EMPLOYED DEVELOPERS WHO CONTRIBUTE TO OPEN SOURCE

  survey %>%
    ggplot(aes(x= Employment,fill= OpenSource)) + geom_bar(position = 'dodge') +
    scale_fill_brewer(palette="Set1") + coord_flip()  + theme(legend.position='none') + labs(title='developers - contribution',x=NULL,y=NULL)

COMPANIES AND THEIR SHARE OF CONTIBUTION TO OPEN SOURCE

survey %>%
    ggplot(aes(x= CompanySize,fill= OpenSource)) + geom_bar(position = 'dodge') +
    scale_fill_brewer(palette="Set1") + coord_flip()  + theme(legend.position='none') + labs(title='companies - contribution',x=NULL,y=NULL)

LANGUAGES THE DEVELOPERS HAVE WORKED WITH

 survey %>%
    filter(!is.na(LanguageWorkedWith)) %>%
     mutate(LanguageWorked = str_split(LanguageWorkedWith,pattern=';')) %>%
     unnest(LanguageWorked) %>%
     group_by(LanguageWorked) %>%
     count() %>%
     ggplot(aes(x= reorder(LanguageWorked,n),y=n,fill=LanguageWorked)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Languages that they use',y='frequency',x=NULL) + theme(legend.position ='none') 

LANGUAGES THE DEVELOPERS WISH TO WORK WITH FOLLOWING YEAR

  survey %>%
     filter(!is.na(LanguageDesireNextYear)) %>%
     mutate(LanguageDesire = str_split(LanguageDesireNextYear,pattern=';')) %>%
     unnest(LanguageDesire) %>%
     group_by(LanguageDesire) %>%
     count() %>%
     ggplot(aes(x= reorder(LanguageDesire,n),y=n,fill=LanguageDesire)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Language Desire to work with next year',y='frequency',x=NULL) +    theme(legend.position='none') 

PLATFORMS THE DEVELOPERS HAVE WORKED WITH

   survey %>%
     filter(!is.na(PlatformWorkedWith)) %>%
     mutate(PlatformWorked = str_split(PlatformWorkedWith,pattern=';')) %>%
     unnest(PlatformWorked) %>%
     group_by(PlatformWorked) %>%
     count() %>%
     ggplot(aes(x= reorder(PlatformWorked,n),y=n,fill=PlatformWorked)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Platforms that they use',y='frequency',x=NULL) + theme(legend.position ='none') 

PLATFORMS THE DEVELOPERS WISH TO WORK WITH FOLLOWING YEAR

 survey %>%
     filter(!is.na(PlatformDesireNextYear)) %>%
     mutate(PlatformDesire= str_split(PlatformDesireNextYear,pattern=';')) %>%
     unnest(PlatformDesire) %>%
     group_by(PlatformDesire) %>%
     count() %>%
     ggplot(aes(x= reorder(PlatformDesire,n),y=n,fill=PlatformDesire)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Platforms Desire to work with next year',y='frequency',x=NULL) + theme(legend.position ='none') 

DATABASES THE DEVELOPERS HAVE WORKED WITH

 survey %>%
     filter(!is.na(DatabaseWorkedWith)) %>%
     mutate(DatabaseWorkedWith= str_split(DatabaseWorkedWith,pattern=';')) %>%
     unnest(DatabaseWorkedWith) %>%
     group_by(DatabaseWorkedWith) %>%
     count() %>%
     ggplot(aes(x= reorder(DatabaseWorkedWith,n),y=n,fill=DatabaseWorkedWith)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Databases that they use',y='frequency',x=NULL) + theme(legend.position ='none') 

DATABASES THE DEVELOPERS WISH TO WORK WITH FOLLOWING YEAR

 survey %>%
     filter(!is.na(DatabaseDesireNextYear)) %>%
     mutate(DatabaseDesireNextYear= str_split(DatabaseDesireNextYear,pattern=';')) %>%
     unnest(DatabaseDesireNextYear) %>%
     group_by(DatabaseDesireNextYear) %>%
     count() %>%
     ggplot(aes(x= reorder(DatabaseDesireNextYear,n),y=n,fill=DatabaseDesireNextYear)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='Database Desire to work with next year',y='frequency',x=NULL) + 
     theme(legend.position ='none')

IDE THE DEVELOPERS USE

  survey %>%
     filter(!is.na(IDE)) %>%
     mutate(IDE= str_split(IDE,pattern=';')) %>%
     unnest(IDE) %>%
     group_by(IDE) %>%
     count() %>%
     ggplot(aes(x= reorder(IDE,n),y=n,fill=IDE)) + 
     geom_bar(stat='identity') + coord_flip() +theme_minimal() + 
     labs(title='IDE',y='frequency',x=NULL) + 
     theme(legend.position ='none')

OS THE DEVELOPERS USE

   survey %>%
     filter(!is.na(OperatingSystem)) %>%
     count(OperatingSystem,sort=T) %>%
   ggplot(aes(x=reorder(OperatingSystem,n),y=n,fill=OperatingSystem)) + 
     geom_bar(stat='identity') +coord_flip() +scale_fill_brewer(palette="Set1") +   labs(title='OS',y='frequency',x=NULL) + theme_minimal() +
     theme(legend.position ='none')

DEVELOPERS WHO WOULD RECOMMEND STACKOVERFLOW

 survey %>%
  filter(!is.na(StackOverflowRecommend)) %>%
      count(StackOverflowRecommend) %>%
      ggplot(aes(x= reorder(StackOverflowRecommend,n), y= n)) + 
      geom_bar(stat='identity',fill= 'coral' ) + coord_flip() + scale_fill_brewer(palette="Set3") + theme(legend.position='none') + labs(title='stackflow recommend - count',x=NULL,y=NULL) 

DEVELOPERS WHO WOULD VISIT STACKOVERFLOW FREQUENTLY

 survey %>%
  filter(!is.na(StackOverflowVisit)) %>%
      count(StackOverflowVisit) %>%
      ggplot(aes(x= reorder(StackOverflowVisit,n), y= n)) + 
      geom_bar(stat='identity',fill= 'coral') + coord_flip() +  scale_fill_brewer(palette="Set1") + theme(legend.position='none') + labs(title='developers & stackoverflow visit',x=NULL,y=NULL) 

DEVELOPERS WHO HAS STACKOVERFLOW ACCOUNT

  survey %>%
    filter(!is.na(StackOverflowHasAccount)) %>%
      count(StackOverflowHasAccount,sort= T) %>%
      ggplot(aes(x= reorder(StackOverflowHasAccount,n),y=n)) +geom_bar(stat='identity',fill= 'coral') + 
      coord_flip() +  scale_fill_brewer(palette="Set1") +  theme(legend.position='none') + labs(title='developers & stackoverflow account',x=NULL,y=NULL) 

DEVELOPERS WHO ARE AWARE OF STACKFLOWJOB BOARD

  survey %>%
  filter(!is.na(StackOverflowJobs)) %>%
      count(StackOverflowJobs,sort= T) %>%
      ggplot(aes(x= reorder(StackOverflowJobs,n),y=n)) +geom_bar(stat='identity',fill= 'coral') + coord_flip() +  scale_fill_brewer(palette="Set1") + theme_minimal() + theme(legend.position='none') + labs(title='developers & stackflowjob board',x=NULL,y=NULL) 

RELATION OF COMPANY SIZE & THEIR EMPLOYEES’S CAREER SATISFACTION LEVEL

  survey %>%
    ggplot(aes(x= CompanySize,fill= CareerSatisfaction)) + geom_bar(position = 'dodge')  +   scale_fill_brewer(palette="Set1") + coord_flip() + 
  labs(title='company size - careersatisfaction',x=NULL,y=NULL) 

FREQUENCY OF SWITCHED JOBS BY DEVELOPERS OVER THEIR TOTAL PERIOD OF EMPLOYMENT

survey %>%
  filter(!is.na(LastNewJob)) %>%
      count(LastNewJob,sort= T) %>%
      ggplot(aes(x= reorder(LastNewJob,n),y=n, fill= LastNewJob)) +geom_bar(stat='identity') + 
      coord_flip() +  scale_fill_brewer(palette="Set3") + theme_minimal() + theme(legend.position='none') +
      labs(title='developers - no of jobs they had',x=NULL,y=NULL)   

HEALTH ASPECTS OF THE DEVELOPERS

survey %>%
    filter(!is.na(WakeTime)) %>%
      count(WakeTime,sort= T) %>%
      ggplot(aes(x= reorder(WakeTime,n),y=n, fill= WakeTime)) +geom_bar(stat='identity') + 
      coord_flip() +  scale_fill_brewer(palette="Set3") + theme_minimal() + theme(legend.position='none') +       labs(title='developers - wakeup time',x=NULL,y=NULL)   

survey %>%
  filter(!is.na(HoursComputer)) %>%
      count(HoursComputer,sort= T) %>%
      ggplot(aes(x= reorder(HoursComputer,n),y=n, fill= HoursComputer)) +geom_bar(stat='identity') + 
      coord_flip() +  scale_fill_brewer(palette="Set3") + theme_minimal() + theme(legend.position='none') +       labs(title='developers - hours they spend on computers',x=NULL,y=NULL) 

survey %>%
  filter(!is.na(HoursOutside)) %>%
      count(HoursOutside,sort= T) %>%
      ggplot(aes(x= reorder(HoursOutside,n),y=n, fill= HoursOutside)) +geom_bar(stat='identity') + 
      coord_flip() +  scale_fill_brewer(palette="Set3") + theme_minimal() + theme(legend.position='none') +
      labs(title='developers - hours they spend outside',x=NULL,y=NULL)  

  survey %>%
  filter(!is.na(SkipMeals)) %>%
      count(SkipMeals,sort= T) %>%
      ggplot(aes(x= reorder(SkipMeals,n),y=n, fill= SkipMeals)) +geom_bar(stat='identity') + 
      coord_flip() +  scale_fill_brewer(palette="Set3") + theme_minimal() + theme(legend.position='none') +
      labs(title='developers - how often they skip meals',x=NULL,y=NULL)  

DEVLOPERS - YOUNG & OLD

survey %>%
  filter(!is.na(Age)) %>%
      count(Age,sort= T) %>%
      ggplot(aes(x= reorder(Age,n),y=n, fill= Age )) +geom_bar(stat='identity') + 
      coord_flip() +scale_fill_brewer(palette="Set3")  + theme_minimal() + theme(legend.position = 'none') +labs(title='developers - age distribution ',x=NULL,y=NULL) 

DEVELOPERS AND THEIR DEPENDENTS

 survey %>%
  filter(!is.na(Dependents)) %>%
      count(Dependents,sort= T) %>%
      ggplot(aes(x= reorder(Dependents,n),y=n, fill= Dependents)) +geom_bar(stat='identity') + 
      coord_flip() + theme_minimal() + theme(legend.position = 'none') +scale_fill_brewer(palette="Set3") +
      labs(title='developers - their dependents ',x=NULL,y=NULL) 

DEVELOPERS - HAVE THEY SERVED US-MILITARY

 survey %>%
  filter(!is.na(MilitaryUS)) %>%
      count(MilitaryUS,sort= T) %>%
      ggplot(aes(x= reorder(MilitaryUS,n),y=n, fill= MilitaryUS)) +geom_bar(stat='identity') + 
      coord_flip() + theme_minimal() + theme(legend.position = 'none') +scale_fill_brewer(palette="Set3") +
      labs(title='developers - us military service ',x=NULL,y=NULL) 

WAS THE SURVEY TOO LONG OR WERE THEY EASY

    survey %>%
  filter(!is.na(SurveyTooLong)) %>%
      count(SurveyTooLong,sort= T) %>%
      ggplot(aes(x= reorder(SurveyTooLong,n),y=n, fill= SurveyTooLong)) +geom_bar(stat='identity') + 
      coord_flip()  + theme_minimal() + theme(legend.position = 'none') +scale_fill_brewer(palette="Set3")+
      labs(title='developers - survey too long ',x=NULL,y=NULL) 

    survey %>%
      filter(!is.na(SurveyEasy)) %>%
      count(SurveyEasy,sort= T) %>%
      ggplot(aes(x= reorder(SurveyEasy,n),y=n, fill= SurveyEasy)) +geom_bar(stat='identity') + 
      coord_flip()  + theme_minimal() + theme(legend.position = 'none') +scale_fill_brewer(palette="Set3")+
      labs(title='developers - survey too easy ',x=NULL,y=NULL) 

‘../input/survey_results_public.csv’