R/rm.plot2.R

Defines functions rm.plot2

Documented in rm.plot2

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

Try the rm.plot package in your browser

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

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