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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: exponentiate.fd
> ### Title: Powers of a functional data ('fd') object
> ### Aliases: exponentiate.fd ^.fd
> ### Keywords: smooth
> 
> ### ** Examples
> 
> ##
> ## sin^2
> ##
> 
> basis3 <- create.fourier.basis(nbasis=3)
> plot(basis3)
> # max = sqrt(2), so
> # integral of the square of each basis function (from 0 to 1) is 1
> integrate(function(x)sin(2*pi*x)^2, 0, 1) # = 0.5
0.5 with absolute error < 3.7e-10
> 
> # sin(theta)
> fdsin <- fd(c(0,sqrt(0.5),0), basis3)
> plot(fdsin)
[1] "done"
> 
> fdsin2 <- fdsin^2
> 
> # check
> fdsinsin <- fdsin*fdsin
> # sin^2(pi*time) = 0.5*(1-cos(2*pi*theta) basic trig identity
> plot(fdsinsin) # good
[1] "done"
> 
> ## Don't show: 
> stopifnot(
+ ## End(Don't show)
+ all.equal(fdsin2, fdsinsin)
+ ## Don't show: 
+ )
> ## End(Don't show)
> 
> ##
> ## sqrt(sin2)
> ##
> plot(fdsin2)
[1] "done"
> fdsin. <- sqrt(fdsin2)
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 8;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 12;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 16;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 20;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 24;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 28;  will be increased by 1
Warning in create.fourier.basis(rng, nbasis = nbasisi, period = diff(rng)) :
  nbasis must be an odd integer; is 32;  will be increased by 1
Warning in exponentiate.fd(e1, e2, tolint = .Machine$double.eps^0.75, basisobj = e1$basis,  :
  Lack of precision in e1^e2: max error at 501 sample points = 0.0372357027101105
> plot(fdsin, main='fdsin and sqrt(fdsin^2)')
[1] "done"
> lines(fdsin., col='red')
> # fdsin is positive and negative
> # fdsin. = sqrt(fdsin^2)
> # has trouble, because it wants to be smooth
> # but theoretically has a discontinuous first derivative at 0.5
> 
> fdsin.5.2 <- fdsin.^2
> resin <- fdsin2-fdsin.5.2
> plot(resin)
[1] "done"
> ## Don't show: 
> stopifnot(
+ ## End(Don't show)
+ max(abs(resin$coefs))<0.01
+ ## Don't show: 
+ )
> ## End(Don't show)
> 
> ##
> ## x^2, x = straight line f(x)=x
> ##
> bspl1 <- create.bspline.basis(norder=2)
> x <- fd(0:1, bspl1)
> plot(x)
[1] "done"
> 
> x2 <- x^2
> plot(x2)
[1] "done"
> 
> er.x <- x-sqrt(x2)
> er.x$coefs
             reps 1
 [1,] -1.462744e-09
 [2,]  5.810687e-10
 [3,] -6.593646e-11
 [4,] -1.478987e-10
 [5,]  1.590038e-10
 [6,] -1.343699e-10
 [7,]  1.032817e-10
 [8,] -7.591832e-11
 [9,]  5.562529e-11
[10,] -4.321783e-11
[11,]  3.989113e-11
[12,] -2.970346e-11
[13,]  1.644111e-11
[14,] -4.987916e-12
> max(er.x$coefs)
[1] 5.810687e-10
> ## Don't show: 
> stopifnot(
+ ## End(Don't show)
+ max(abs(er.x$coefs))<10*.Machine$double.eps
+ ## Don't show: 
+ )
Error: max(abs(er.x$coefs)) < 10 * .Machine$double.eps is not TRUE
Execution halted