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

> ### Name: smooth.construct.tp.smooth.spec
> ### Title: Penalized thin plate regression splines in GAMs
> ### Aliases: smooth.construct.tp.smooth.spec
> ###   smooth.construct.ts.smooth.spec tprs
> ### Keywords: models regression
> 
> ### ** Examples
> 
> require(mgcv); n <- 100; set.seed(2)
> x <- runif(n); y <- x + x^2*.2 + rnorm(n) *.1
> 
> ## is smooth significantly different from straight line?
> summary(gam(y~s(x,m=c(2,0))+x,method="REML")) ## not quite

Family: gaussian 
Link function: identity 

Formula:
y ~ s(x, m = c(2, 0)) + x

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.02133    0.05315  -0.401    0.689    
x            1.18249    0.10564  11.193   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
        edf Ref.df     F p-value  
s(x) 0.9334      8 0.304  0.0781 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =   0.91   Deviance explained = 91.1%
-REML = -70.567  Scale est. = 0.012767  n = 100
> 
> ## is smooth significatly different from zero?
> summary(gam(y~s(x),method="REML")) ## yes!

Family: gaussian 
Link function: identity 

Formula:
y ~ s(x)

Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.5600     0.0113   49.56   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
       edf Ref.df     F p-value    
s(x) 1.933  2.417 413.1  <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =   0.91   Deviance explained = 91.1%
-REML = -69.353  Scale est. = 0.012767  n = 100
> 
> ## Fool bam(...,discrete=TRUE) into (strange) nested
> ## model fit...
> set.seed(2) ## simulate some data... 
> dat <- gamSim(1,n=400,dist="normal",scale=2)
Gu & Wahba 4 term additive model
> dat$x1a <- dat$x1 ## copy x1 so bam allows 2 copies of x1
> ## Following removes identifiability problem, by removing
> ## linear terms from second smooth, and then re-inserting
> ## the one that was not a duplicate (x2)...
> b <- bam(y~s(x0,x1)+s(x1a,x2,m=c(2,0))+x2,data=dat,discrete=TRUE)
Error in if (nthreads > 1 && !mgcv.omp()) warning("openMP not available: single threaded computation only") : 
  missing value where TRUE/FALSE needed
Calls: bam
Execution halted