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 raw.means.plot package in your browser

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

raw.means.plot documentation built on May 2, 2019, 5 p.m.