Difference between revisions of "Visualization Tools"
From Self-Organization Wiki
(→Box plots with R) |
(→Data manipulation with R) |
||
Line 23: | Line 23: | ||
storing every nth column with n=3 | storing every nth column with n=3 | ||
− | y | + | y <- x[seq(1,ncol(x),3)] |
storing every nth line with n=3, starting from first. | storing every nth line with n=3, starting from first. | ||
− | z | + | z <- x[(seq(1,nrow(x),3)), ] |
Revision as of 15:03, 22 June 2012
Box plot
A box plot is a good way to depict results where measurements have been taken over another parameter, for example the fitness of several independent runs of an evolutionary algorithm over the number of generations.
Box plots with R
The statistic software R can be installed quickly, e.g., on Debian/Ubuntu Linux by "apt-get install r-base". The data must be given in a tab-seperated file, where each column comprises the measurements for one box.
x <- read.table("datafilename.tsv") postscript("outputfilename.ps") boxplot(x) dev.off()
The postscript command redirects the output to a postscript file. The last command flushes the output and closes the file.
Data manipulation with R
Sometimes it is necessary to postprocess data before plotting it.
x <- read.table("datafilename.tsv")
storing every nth column with n=3
y <- x[seq(1,ncol(x),3)]
storing every nth line with n=3, starting from first.
z <- x[(seq(1,nrow(x),3)), ]