I am a R beginner. I intend to make a picture showing different levels of software experience in [R, data manipulation and modeling] of people in different programs.

Here I go! re-knitting

setwd("/Users/Emily/Documents/Columbia/Data Visualization")
r<-read.csv("responses-2014-09-05.csv",stringsAsFactors=F)
str(r)
## 'data.frame':    55 obs. of  13 variables:
##  $ Timestamp                                                                                  : chr  "9/4/2014 18:16:46" "9/4/2014 18:17:10" "9/4/2014 18:17:12" "9/4/2014 18:17:30" ...
##  $ Program                                                                                    : chr  "Other PhD" "QMSS Second semester +" "Other masters" "QMSS Second semester +" ...
##  $ Baseline.experience                                                                        : chr  "Excel, Stata, SPSS, dropbox, google drive (formerly docs)" "Excel, SQL, Web: html, css, js" "Excel, R, Stata, SPSS, Rstudio, dropbox" "Excel, R" ...
##  $ Do.you.use.twitter.                                                                        : chr  "No" "Yes" "Yes" "No" ...
##  $ Software.experience..the.smaller.list...R..data.manipulation.and.modeling.                 : chr  "None" "None" "A little" "A little" ...
##  $ Software.experience..the.smaller.list...R..graphics..base..lattice..ggplot2..or.grid..     : chr  "None" "None" "A little" "A little" ...
##  $ Software.experience..the.smaller.list...Reproducible.research..sweave..knitr..ipnb..etc... : chr  "None" "None" "A little" "None" ...
##  $ Software.experience..the.smaller.list...Python.                                            : chr  "None" "None" "None" "None" ...
##  $ Software.experience..the.smaller.list...Version.control..git..mercurial..subversion..etc...: chr  "None" "None" "A little" "None" ...
##  $ Software.experience..the.smaller.list...Databases..any..                                   : chr  "None" "A little" "A little" "None" ...
##  $ Software.experience..the.smaller.list...Web.frontend..html.css.basic.js.jquery..           : chr  "None" "A little" "A little" "None" ...
##  $ Software.experience..the.smaller.list...Serious.javascript..angular.ember.node.d3..        : chr  "None" "None" "A little" "None" ...
##  $ Are.you.on.the.waitlist.                                                                   : chr  "No" "No" "No" "No" ...


##1st try##

library(ggplot2)
ggplot(r,aes(x=Program, y=Software.experience..the.smaller.list...R..data.manipulation.and.modeling.))+geom_point(shape=1)

plot of chunk unnamed-chunk-3

TERRIBLE


###give different levels numbers###
r$soft.r[r$Software.experience..the.smaller.list...R..data.manipulation.and.modeling.=="Expert"]<-3
r$soft.r[r$Software.experience..the.smaller.list...R..data.manipulation.and.modeling.=="Confident"]<-2
r$soft.r[r$Software.experience..the.smaller.list...R..data.manipulation.and.modeling.=="A little"]<-1
r$soft.r[r$Software.experience..the.smaller.list...R..data.manipulation.and.modeling.=="None"]<-0
table(r$soft.r)
## 
##  0  1  2  3 
## 14 17 22  2


##2nd try##

r$soft.r.level<-ordered(r$soft.r, level=c(0,1,2,3),labels=c("None","A little", "Confident", "Expert"))
ggplot(r,aes(x=Program, y=soft.r.level))+geom_point(shape=1)

plot of chunk unnamed-chunk-5

Now the labels of y-axis are listed in order

But it is still not what I want


#3rd try##

##trying to count numbers, but it seems that I used wrong function##

r$sum.soft.r<-sum(r$soft.r)
ggplot(r,aes(x=soft.r.level, y=sum.soft.r, fill=Program))+geom_bar(stat="identity", position="dodge")

plot of chunk unnamed-chunk-6

Close to what I want, but the counts of levels hasn’t been represented because I used wrong function


#4th try#

qplot(x=soft.r.level, fill=Program,data=r,geom="bar",stat="bin")

plot of chunk unnamed-chunk-7

ggplot(r,aes(x=soft.r.level, fill=Program))+geom_bar(stat="bin", position="dodge")+xlab("Levels in R, Data Manipulation & Modeling") + 
    ylab("Count") + 
    ggtitle("Different Levels in R of Different Programs")

plot of chunk unnamed-chunk-7

Remaining Questions:

  1. Why the pictures are different using qplot and ggplot?

  2. How to add count numbers over each bar?