R/ordergrouped.R

#$Id: ordergrouped.R 45 2011-09-23 20:12:00Z gsawitzki $
ordergrouped <- function(..., group, na.last = TRUE, decreasing = FALSE){
	if (missing(group))
	{order(..., na.last = na.last, decreasing = decreasing)} else {
		ox <- order(..., na.last = na.last, decreasing = decreasing)
		ogro <- order(group[ox])
		ox[ogro]
	}
}

Try the bertin package in your browser

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

bertin documentation built on May 2, 2019, 5:54 p.m.