Why is it so difficult to make things in ggplot2 , i like the way it helps in customisation but the curve is steep nevertheless 

Here is my sample dataframe 

    df <-           gene        HSC       CMP
           ENSG00000158292.6  1.8102636  2.456869
           ENSG00000162496.6  2.6796705  6.203838
           ENSG00000117115.10  3.4509115  5.555739
           ENSG00000159423.14  3.6809277  5.063446
           ENSG00000053372.4  5.7089974  6.851090

If i have plot a boxplot i can simply write this  `boxplot(df[,-1],col=c("red","blue"))`

I get a boxplot but when im trying with ggplot2 im having difficult time 


    ex <- melt(df, id.vars=c("HSC", "CMP"))
    ggplot(data = ex,
           aes(x = CMP, y = HSC)) +
      geom_boxplot()

I get a single boxplot what i want is i get a box plot for HSC and CMP which i got when i use simple base R boxplot .

Any help or suggestion would be highly appreciated  with my ggplot2 code 

Devon got there before me but as he mentioned the id.vars needs to be set to 'gene'

Here's a boxplot with scatterplot overlay for anyone else arriving here from Google.

I do agree that ggplot can be difficult to work with. Many functions redundant in the sense that they do the same thing as other but have different names, and conflicts frequently arise. That said, if you can master ggplot, then you can produce very nice graphics for publications.

    require(reshape2)
    require(ggplot2)
    
    ex <- melt(df, id.vars=c("gene"))
    colnames(ex) <- c("gene","group","exprs")
    
    ggplot(data=ex, aes(x=group, y=exprs)) +
    
    	geom_boxplot(position=position_dodge(width=0.5), outlier.shape=17, outlier.colour="red", outlier.size=0.1, aes(fill=group)) +
    
    	#Choose which colours to use; otherwise, ggplot2 choose automatically
    	#scale_color_manual(values=c("red3", "white", "blue")) + #for scatter plot dots
    	scale_fill_manual(values=c("red", "royalblue")) + #for boxplot
    
    	#Add the scatter points (treats outliers same as 'inliers')
    	geom_jitter(position=position_jitter(width=0.3), size=3.0, colour="black") +
    
    	#Set the size of the plotting window
    	theme_bw(base_size=24) +
    
    	#Modify various aspects of the plot text and legend
    	theme(
    		legend.position="none",
    		legend.background=element_rect(),
    		plot.title=element_text(angle=0, size=14, face="bold", vjust=1),
    
    		axis.text.x=element_text(angle=45, size=14, face="bold", hjust=1.10),
    		axis.text.y=element_text(angle=0, size=14, face="bold", vjust=0.5),
    		axis.title=element_text(size=14, face="bold"),
    
    		#Legend
    		legend.key=element_blank(),		#removes the border
    		legend.key.size=unit(1, "cm"),		#Sets overall area/size of the legend
    		legend.text=element_text(size=12),	#Text size
    		title=element_text(size=12)) +		#Title text size
    
    	#Change the size of the icons/symbols in the legend
    	guides(colour=guide_legend(override.aes=list(size=2.5))) +
    
    	#Set x- and y-axes labels
    	xlab("Stem cell class") +
    	ylab("Expression") +
    
    	#ylim(0, 0) +
    
    	ggtitle("My plot")

<a href="https://ibb.co/isw956"><img src="https://preview.ibb.co/niQ2Q6/boxscatter.png" alt="boxscatter" border="0"></a>
