Running examples in ‘SpatPCA-Ex.R’ failed
The error most likely occurred in:

> ### Name: spatpca
> ### Title: Regularized PCA for spatial data
> ### Aliases: spatpca
> 
> ### ** Examples
> 
> ###### 1D: regular locations
> x_1D <- as.matrix(seq(-5, 5, length = 50))
> Phi_1D <- exp(-x_1D^2) / norm(exp(-x_1D^2), "F")
> set.seed(1234)
> Y_1D <- rnorm(n = 100, sd = 3) %*% t(Phi_1D) + matrix(rnorm(n = 100 * 50), 100, 50)
> cv_1D <- spatpca(x = x_1D, Y = Y_1D)

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: 
warning: 
warning: inv_sympd(): given matrix is not symmetricinv_sympd(): given matrix is not symmetric
inv_sympd(): given matrix is not symmetric


warning: inv_sympd(): given matrix is not symmetric

error: inv_sympd(): matrix is singular or not positive definite

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric
warning: inv_sympd(): given matrix is not symmetric


warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric

warning: inv_sympd(): given matrix is not symmetric
Error in spatpcaCV(x, Y, M, k, tau1, tau2, gamma, stra, maxit, thr, l2) : 
  inv_sympd(): matrix is singular or not positive definite
Calls: spatpca -> spatpcaCV
Execution halted