R-alpha: Bug in tapply in the Windows version of September

Comblain muriel Muriel.Comblain@ulg.ac.be
Mon, 08 Dec 1997 12:13:37 +0100



The function tapply is not working in the Windows version of R=20
(Version 0.50 Beta (Sept 29, 1997))

In

tapply <- function (x, INDEX, FUN=3DNULL, simplify=3DTRUE, ...)=20
...

The part:

	if (simplify && all(unlist(lapply(ans, length)) =3D=3D 1)) {
		ans <- unlist(ans, recursive =3D FALSE)
		names(ans)<-namelist[[1]]
		return(ans)
	}

should be replaced by

	if (simplify && all(unlist(lapply(ans, length)) =3D=3D 1)) {
		ans <- unlist(ans, recursive =3D FALSE)
		if(length(INDEX) =3D=3D 1) {
		names(ans) <- namelist[[1]]
		}
		else {
		dim(ans) <- extent
		dimnames(ans) <- namelist
		}
		return(ans)
	}

Muriel Comblain
M=E9thodologie Quantitative
Facult=E9 de Sociologie
Universit=E9 de Li=E8ge=20
Bvd du Rectorat, 7
B4000 Liege, Belgique


Tel: +32 4 366 30 91
E-mail: Muriel.Comblain

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._