dir <- paste(system.file("loading_tests",package="scmamp"), "experiment_files", sep="/")
# The format of the files is rgg_size_SIZE_r_RADIUS_ALGORITHM.out, where variables
# to extract are in capital letters.
list.files(dir)[1:5]
# The regular expresion can be as simple as substituting each variable name in the expression
# above by ([XXX]*), where XXX is the list of symbols that appear in the name.
pattern <- "rgg_size_([0-9]*)_r_(0.[0-9]*)_([a-z,A-Z,1,2]*).out"
var.names <- c("Size", "Radius", "Algorithm")
data <- readExperimentDir (directory=dir, names=var.names, fname.pattern=pattern,
alg.var.name="Algorithm", value.col="Evaluation",
col.names="Evaluation")
dim(data)
head(data)
Run the code above in your browser using DataLab