Mercurial > repos > moheydarian > ggplot_histogram
comparison ggplotscripthistogram.R @ 24:b9118a9b5109 draft
Uploaded
| author | moheydarian |
|---|---|
| date | Tue, 11 Apr 2017 18:22:45 -0400 |
| parents | eeff8405f1ac |
| children | b4d1be4880da |
comparison
equal
deleted
inserted
replaced
| 23:eeff8405f1ac | 24:b9118a9b5109 |
|---|---|
| 66 gg_legend = theme(legend.position="none") | 66 gg_legend = theme(legend.position="none") |
| 67 } | 67 } |
| 68 | 68 |
| 69 #density | 69 #density |
| 70 if(options$density == "counts"){ | 70 if(options$density == "counts"){ |
| 71 gg_density = ggplot(input,aes(value ,color=variable)) | 71 gg_density = ggplot(input,aes(value, color=variable)) |
| 72 gg_freq = NULL | 72 gg_freq = NULL |
| 73 } else if(options$density == "ndensity"){ | 73 } else if(options$density == "ndensity"){ |
| 74 gg_density = ggplot(input,aes(value, ..ncount..,color=variable)) | 74 gg_density = ggplot(input,aes(value, ..ncount.., color=variable)) |
| 75 gg_freq = NULL | 75 gg_freq = NULL |
| 76 } else if(options$density == "freq"){ | 76 } else if(options$density == "freq"){ |
| 77 gg_density = ggplot(input,aes(value,color=variable)) | 77 gg_density = ggplot(input,aes(value, color=variable)) |
| 78 gg_freq = aes(y=..count../sum(..count..)) | 78 gg_freq = aes(y=..count../sum(..count..)) |
| 79 } else { | |
| 80 | |
| 79 } | 81 } |
| 80 | 82 |
| 81 #Choose between automatically scaled x and y axis or user defined | 83 #Choose between automatically scaled x and y axis or user defined |
| 82 if(options$scaling == "Automatic"){ | 84 if(options$scaling == "Automatic"){ |
| 83 gg_scalex = NULL | 85 gg_scalex = NULL |
