R/stslist.freq-methods.R

Defines functions print.stslist.freq

Documented in print.stslist.freq

## ===========================
## Methods for stsstatd objects
## ===========================

print.stslist.freq <- function(x, digits=2, ...) {
	table <- attr(x,"freq")
	print(table, digits=digits, ...)
}

"[.stslist.freq" <- function(x,i,j,drop=FALSE) {
	## Column subscript are not allowed
	if (!missing(j))
		stop(" [!] Column subscripts are not allowed", call.=FALSE)

	x <- NextMethod("[")

	if (!missing(i)) {
		attr(x,"weights") <- attr(x,"weights")[i]
		attr(x,"freq") <- attr(x,"freq")[i,]
	}
	
	return(x)
 }

Try the TraMineR package in your browser

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

TraMineR documentation built on Dec. 8, 2024, 3:01 p.m.