Mercurial > repos > moheydarian > ggplot_histogram
comparison ggplotscripthistogram.R @ 26:b4d1be4880da draft
Uploaded
| author | moheydarian |
|---|---|
| date | Tue, 11 Apr 2017 18:29:08 -0400 |
| parents | b9118a9b5109 |
| children | 1d1518b029d1 |
comparison
equal
deleted
inserted
replaced
| 25:66fec1f0eb2e | 26:b4d1be4880da |
|---|---|
| 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 == "cat"){ |
| 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 { | 79 } else { |
| 80 | 80 |
| 81 } | 81 } |
| 82 | 82 |
| 83 #Choose between automatically scaled x and y axis or user defined | 83 #Choose between automatically scaled x and y axis or user defined |
| 84 if(options$scaling == "Automatic"){ | 84 if(options$scaling == "Automatic"){ |
| 85 gg_scalex = NULL | 85 gg_scalex = NULL |
