Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Boris Steipe
* ... in the same vector. On Dec 3, 2015, at 10:48 AM, Boris Steipe wrote: > It's very commendable that you try writing your own functions to learn R. Of > course the function factorize() is in gmp, but that's beside the point. > > Your code looks messy - before asking your question you could

Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Boris Steipe
It's very commendable that you try writing your own functions to learn R. Of course the function factorize() is in gmp, but that's beside the point. Your code looks messy - before asking your question you could have removed all these print statements. It gets further messed up because you posted

Re: [R] Problems trying to generate a prime factor vector

2015-12-03 Thread Franklin Bretschneider
Hi Kevin Wright, Re: > > I am very new to 'R' and am trying to write an R function which returns the > prime factors of a given number(n) > > Unfortunately, the function only works for very small numbers, if for > example I pass 18 to the function > a mysteriously long vector is returned. I ha

[R] Problems trying to generate a prime factor vector

2015-12-03 Thread Kevin Wright
Hi, I am very new to 'R' and am trying to write an R function which returns the prime factors of a given number(n) Unfortunately, the function only works for very small numbers, if for example I pass 18 to the function a mysteriously long vector is returned. I have not been able to find where or