# HG changeset patch # User moheydarian # Date 1491943426 14400 # Node ID 19546f3ef70a7747baa0ab31eccbce006907fa4c # Parent bd1c3f88daa9e6dd3a066d1e89605a9cdd5d3e51 Uploaded diff -r bd1c3f88daa9 -r 19546f3ef70a ggplotscripthistogram.R --- a/ggplotscripthistogram.R Tue Apr 11 16:43:35 2017 -0400 +++ b/ggplotscripthistogram.R Tue Apr 11 16:43:46 2017 -0400 @@ -37,6 +37,7 @@ 'dim', 'k', 2, 'character', 'scaling', 'j', 2, 'character', 'legend', 'l', 2, 'character', + 'density', 'm', 2, 'character', 'output', 'o', 2, 'character' ), byrow=TRUE, ncol=4); @@ -65,6 +66,13 @@ gg_legend = theme(legend.position="none") } +#density +if(options$density == "counts"){ + gg_density = NULL +} else { + gg_density = , ...density..., +} + #Choose between automatically scaled x and y axis or user defined if(options$scaling == "Automatic"){ gg_scalex = NULL @@ -112,7 +120,7 @@ gg_colorscale = scale_color_brewer(palette=options$colors, direction=options$colororder) } -ggplot(input,aes(value,color=variable)) + +ggplot(input,aes(value gg_density,color=variable)) + geom_freqpoly(binwidth=options$binwidth,size=options$size)+gg_facet+gg_colorscale+ gg_scalex+gg_scaley+theme_bw()+xlab(options$xlab)+ylab(options$ylab)+gg_legend+ ggtitle(options$title)