From Muriel.Comblain@ulg.ac.be  Mon Dec  8 11:13:37 1997
From: Muriel.Comblain@ulg.ac.be (Comblain muriel)
Date: Mon, 08 Dec 1997 12:13:37 +0100
Subject: R-alpha: Bug in tapply in the Windows version of September
Message-ID: <3.0.1.32.19971208121337.008f44a0@pop3.mailst.ulg.ac.be>



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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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