File: rm.plot2.R

package info (click to toggle)
r-cran-plotrix 3.8-4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,588 kB
  • sloc: makefile: 6
file content (14 lines) | stat: -rwxr-xr-x 567 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

raw.means.plot2 <- function(data, col.id, col.offset, col.x, col.value, fun.aggregate = "mean", ... ) {
	
	if(!is.data.frame(data)) stop("data must be a data.frame")
	
	columns <- c(col.id, col.offset, col.x, col.value)
	
	if (any(!(columns %in% colnames(data)))) stop("column not matching the data")
	
	formula.agg <- as.formula(paste(col.value, "~", col.id, "+", col.offset, "+", col.x))
	
	d.new <- aggregate(formula.agg, data = data, FUN = fun.aggregate)
	raw.means.plot(d.new, col.offset = col.offset, col.x = col.x, col.value = col.value, ...)
}