annotate boxplot.r @ 34:0197da753d1e draft default tip

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