R/stacksasfactor.R

Defines functions stacksasfactor

Documented in stacksasfactor

# $HeadURL: file:///srv/svn/sintro/pkg/sprof/R/stacksasfactor.R $
# %$Id: stacksasfactor.R 226 2013-08-26 20:09:31Z gsawitzki $
# %$Revision: 226 $
# %$Date: 2013-08-26 22:09:31 +0200 (Mon, 26 Aug 2013) $
# %$Author: gsawitzki $
# %$Name:$
#
# source('~/projects/rforge/sintro/pkg/sprof/R/stacksasfactor.R', chdir = TRUE)
#
# setwd("")
#! To Do
#! clean up


#\details
stacksasfactor <- function(sprof, sel, events)
{
	if (!missing(events) & !missing(sel) )  
		stop("stacksasfactor: stacks can be selected by index of by event, not both.")
	if (!missing(events)) sel <- sprof$profiles$data[events] else {
	 if (missing(sel)) sel <- seq(along=sprof$stacks$nodes)
	}
	 src <- sprof$stacks$nodes[sel]
	 asfactormodel(src, factormodel = as.character(sprof$nodes$name))
}

Try the sprof package in your browser

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

sprof documentation built on May 2, 2019, 4:45 p.m.