annotate boxplot.r @ 30:945df4c98ee3 draft

Uploaded
author guerler
date Tue, 29 Apr 2014 16:03:41 -0400
parents a3b34c760a79
children e10dbc437d8f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
1 wrapper <- function(table, columns, options) {
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
2
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
3 # initialize output list
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
4 l <- list()
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
5
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
6 # loop through all columns
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
7 for (key in names(columns)) {
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
8 # load column data
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
9 column <- as.numeric(columns[key])
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
10 column_data <- sapply( table[column], as.numeric )
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
11
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
12 # create hist data
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
13 data <- boxplot(column_data, plot=FALSE)
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
14
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
15 # collect vectors in list
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
16 l <- append(l, list(data$stats))
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
17 }
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
18
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
19 # return
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
20 return (l)
a3b34c760a79 Uploaded
guerler
parents:
diff changeset
21 }