R/rm.plot2.R

Defines functions raw.means.plot2

Documented in raw.means.plot2

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, ...)
}

Try the plotrix package in your browser

Any scripts or data that you put into this service are public.

plotrix documentation built on Nov. 10, 2023, 5:07 p.m.