Allow to select datafile for charts/explore/compare (filtered/non-filtered)
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
library(ggplot2)
|
||||
|
||||
# Usage: Rscript single_result.r exp_abspath
|
||||
# Usage: Rscript single_result.r exp_abspath [resultsdata_file]
|
||||
|
||||
args <- commandArgs(trailingOnly = TRUE)
|
||||
experiment <- args[1]
|
||||
datafile <- paste(experiment, "/resultsdata.csv", sep = "")
|
||||
resultsdata_file <- if (length(args) >= 2) args[2] else "resultsdata.csv"
|
||||
suffix <- gsub("^resultsdata|\\.csv$", "", resultsdata_file)
|
||||
datafile <- file.path(experiment, resultsdata_file)
|
||||
|
||||
if (!file.exists(datafile)) {
|
||||
print(paste("Input file", datafile, "is missing"))
|
||||
@ -21,6 +23,6 @@ plot <- ggplot(data, aes(x = benchmark, y = faults, fill = resulttype)) +
|
||||
theme_minimal()
|
||||
|
||||
ggsave(
|
||||
paste(experiment, "/single_result.svg", sep = ""),
|
||||
paste0(experiment, "/single_result", suffix, ".svg"),
|
||||
plot = plot,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user