Added an option to set the output path of the plotting script. Changed name and order of the options of the plotting script.
This commit is contained in:
parent
52c629b9b8
commit
3eba87d47a
11
plot/plot.r
11
plot/plot.r
@ -6,11 +6,14 @@ library(tidyverse)
|
|||||||
|
|
||||||
# Parsing command line arguments:
|
# Parsing command line arguments:
|
||||||
options = commandArgs(trailingOnly = TRUE)
|
options = commandArgs(trailingOnly = TRUE)
|
||||||
filename = options[1]
|
plot_type = options[1]
|
||||||
plot_type = options[2]
|
input = options[2]
|
||||||
table_header = options[-1:-2]
|
output = options[3]
|
||||||
|
table_header = options[-1:-2:-3]
|
||||||
|
|
||||||
read_csv(filename, col_names = table_header) %>%
|
pdf(output)
|
||||||
|
|
||||||
|
read_csv(input, col_names = table_header) %>%
|
||||||
mutate(timestamp = as_date(as_datetime(timestamp))) %>% # Formatting the date
|
mutate(timestamp = as_date(as_datetime(timestamp))) %>% # Formatting the date
|
||||||
melt(id.vars = "timestamp", variable.name = "category", value.name = "amount") %>% # Formatting the table to plot each category
|
melt(id.vars = "timestamp", variable.name = "category", value.name = "amount") %>% # Formatting the table to plot each category
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user