Re: Re[4]: [S] factors (divisors ) of an integer

Frank E Harrell Jr (
Fri, 11 Sep 1998 09:43:23 -0400

How about doing most of the job with

factorize <- function(n)
p <- n/(w <- c(1:trunc(sqrt(n)),n))
w[trunc(p) == p]

Frank E Harrell Jr
Professor of Biostatistics and Statistics
Division of Biostatistics and Epidemiology
Department of Health Evaluation Sciences
University of Virginia School of Medicine

This message was distributed by To unsubscribe
send e-mail to with the BODY of the
message: unsubscribe s-news