[R] Prime Factorization

David Winsemius dwinsemius at comcast.net
Tue Sep 21 22:22:11 CEST 2010


On Sep 21, 2010, at 3:44 PM, Spencer Graves wrote:

> Hello:
>
>      It's hard to RTFM if you don't know which FMTR.  I only found  
> one with the "obvious search strategy" with my favorite search  
> tools, which may nevertheless be unfamiliar to Cliff Clive.
>
> RSiteSearch('prime factorization') # produced 3 matches, the first  
> of which is the "primeFactors" function in the "surveillance" package.
>
> install.packages('sos') # if you don't already have it
> library(sos)
> pf <- findFn('prime factorization') # only 3 matches
> pf # open the result in a web browser with a link to the  
> "primeFactors" function above.
>
>
> DAVID:  You say there are "At least two." How can I find the other  
> one?

With my second favorite search strategy (using sos's "???" function)  
and "prime factors" I got schoolmath's prime.factor() and  
conf.design's factorize()

(I had already gotten the same results at Baron's search page so I  
conclude that it was pretty easy.)

Going to a slightly more general search, "prime factor", I also found  
another factorize() in the elliptic package.

With ???"prime factor*" I got 147 hits but have not had the time to  
thoroughly search through them to see if I can get any more.

(I do see another function,  primesieve, in spuRs but it doesn't  
appear to factorize.)

Stopping at one search strategy seems to severely limit the values of  
a search engine.

-- 
David.


>
>
>      Thanks,
>      Spencer
>
>
> On 9/21/2010 11:14 AM, David Winsemius wrote:
>>
>> On Sep 21, 2010, at 11:33 AM, Cliff Clive wrote:
>>
>>>
>>> Hi everyone, I have a very quick question:
>>>
>>> Is there a ready-made function in R or any R packages to find the  
>>> prime
>>> factorization of an integer?
>>
>> Yes. At least two. The obvious search strategy with your favrite  
>> search tool should work well.
>>
>
>
> -- 
> Spencer Graves, PE, PhD
> President and Chief Operating Officer
> Structure Inspection and Monitoring, Inc.
> 751 Emerson Ct.
> San José, CA 95126
> ph:  408-655-4567
>

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list