Browse Source

Polish clusterviz

Petra Lamborn 5 years ago
parent
commit
4325ad4384
2 changed files with 15 additions and 3 deletions
  1. 0
    2
      R/clusterviz.R
  2. 15
    1
      README.md

+ 0
- 2
R/clusterviz.R View File

@@ -11,8 +11,6 @@ parser$add_argument("--pkl", dest = "csv", help = "load from pickle instead of c
11 11
 
12 12
 args <- parser$parse_args()
13 13
 
14
-print(args)
15
-
16 14
 library(ggplot2, warn.conflicts = FALSE, quietly = TRUE)
17 15
 library(dplyr, warn.conflicts = FALSE, quietly = TRUE)
18 16
 library(tidyr, warn.conflicts = FALSE, quietly = TRUE)

+ 15
- 1
README.md View File

@@ -205,5 +205,19 @@ install.packages(c("dplyr", "tidyr", "ggplot2", "forecast", "TSA", "reticulate",
205 205
 
206 206
 ### `clusterviz.R`
207 207
 
208
-This script visualises the patterns of each cluster in an aggregated file.
208
+This script visualises the patterns of each cluster in an aggregated file, saving plots in a directory. Unfortunately, when loading directly from a pickle (with the `--pkl` option) this requires the python module `pandas` to have been installed outside of a virtual environment, with `pip install --user pandas`. The script is called with `Rscript clusterviz.R [options]`.
209 209
 
210
+* `cluster_file`: Source csv or pickle for visualisation.
211
+* `-i IMG_PATH`: Path for directory to store plots; default: `../img/`.
212
+* `-p POSTFIX`: Postfix for image files, identifying this "batch" of clusters; default: `_plot`.
213
+* `--width WIDTH`: Width of plot output in cm
214
+* `--height HEIGHT`: Height of plot output in cm
215
+* `--pkl`: Load directly from a pickle instead of a csv file.
216
+
217
+Example:
218
+
219
+```bash
220
+Rscript clusterviz.R ../data/5k-ag.csv -p "_5k"
221
+```
222
+
223
+Create plots for a csv (created with `pickletocsv.py`) located at `../data/5k-ag.csv` and postfix them with `_5k` (as in `all_fre_5k.png`).