https://github.com/cran/pracma
Tip revision: c79a04b5074656b36e591191eb8137b70a349932 authored by Hans W. Borchers on 30 June 2014, 00:00:00 UTC
version 1.7.0
version 1.7.0
Tip revision: c79a04b
vander.R
###
### VANDER.R Vandermonde matrix
###
vander <- function(x) {
n <- length(x)
if (n == 0) return(matrix(0, nrow=0, ncol=0))
if ((!is.numeric(x) && !is.complex(x)) || is.array(x))
stop("Argument 'x' must be a numeric or complex vector.")
A <- outer(x, seq(n-1, 0), "^")
return(A)
}