prime_factors {primes}R Documentation

Perform Prime Factorization on a Vector

Description

Compute the prime factors of elements of an integer vector.

Usage

prime_factors(x)

Arguments

x

an integer vector.

Value

A list of integer vectors reflecting the prime factorizations of each element of the input vector.

Author(s)

Paul Egeler, MS

Examples

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


[Package primes version 1.6.0 Index]