powered by
Compute the prime factors of elements of an integer vector.
prime_factors(x)
A list of integer vectors reflecting the prime factorizations of each element of the input vector.
an integer vector.
Paul Egeler, MS
prime_factors(c(1, 5:7, 99)) ## [[1]] ## integer(0) ## ## [[2]] ## [1] 5 ## ## [[3]] ## [1] 2 3 ## ## [[4]] ## [1] 7 ## ## [[5]] ## [1] 3 3 11
Run the code above in your browser using DataLab