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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: psdfun
> ### Title: Regression analysis for survival curves.
> ### Aliases: psdfun
> 
> ### ** Examples
> 
> data(Npop)
> psd_D1<-psdfun(ax=Npop$ax,index="Deevey1")
> psd_D1
$Summary

Formula: ax ~ a + b * age

Parameters:
  Estimate Std. Error t value Pr(>|t|)    
a   5603.9     1062.0   5.277 0.000509 ***
b   -642.3      156.6  -4.102 0.002669 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1642 on 9 degrees of freedom

Number of iterations to convergence: 2 
Achieved convergence tolerance: 1.49e-08


$Goodness
      MSE    RMSE   Rsquare adj.Rsquare     MAE     MAPE      RASE      AIC
1 2206682 1485.49 0.6515192    0.564399 1234.35 17.69146 0.7053431 197.8937
       BIC
1 197.8937

$Data
   age ageclass   ax    predict
1    1        I 8283  4961.5455
2    2       II 5238  4319.2364
3    3      III 1921  3676.9273
4    4       IV 1425  3034.6182
5    5        V  926  2392.3091
6    6       VI  659  1750.0000
7    7      VII  479  1107.6909
8    8     VIII  228   465.3818
9    9       IX   57  -176.9273
10  10        X   24  -819.2364
11  11       XI   10 -1461.5455

> psd_D2<-psdfun(ax=Npop$ax,index="Deevey2")
> psd_D2
$Summary

Formula: ax ~ a * exp(-b * age)

Parameters:
   Estimate Std. Error t value Pr(>|t|)    
a 1.504e+04  9.717e+02   15.48 8.59e-08 ***
b 5.828e-01  3.883e-02   15.01 1.12e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 318.7 on 9 degrees of freedom

Number of iterations to convergence: 17 
Achieved convergence tolerance: 1.49e-08


$Goodness
      MSE     RMSE   Rsquare adj.Rsquare      MAE      MAPE      RASE      AIC
1 83111.3 288.2903 0.9869709   0.9837137 188.8823 0.4079135 0.1079327 161.8239
       BIC
1 161.8239

$Data
   age ageclass   ax    predict
1    1        I 8283 8396.40389
2    2       II 5238 4687.87598
3    3      III 1921 2617.33255
4    4       IV 1425 1461.30779
5    5        V  926  815.87663
6    6       VI  659  455.51983
7    7      VII  479  254.32560
8    8     VIII  228  141.99494
9    9       IX   57   79.27854
10  10        X   24   44.26276
11  11       XI   10   24.71276

> psd_D3<-psdfun(ax=Npop$ax,index="Deevey3")
> psd_D3
$Summary

Formula: ax ~ a * (age^-b)

Parameters:
   Estimate Std. Error t value Pr(>|t|)    
a 8691.1232   633.3189  13.723 2.44e-07 ***
b    1.2598     0.1326   9.499 5.48e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 649 on 9 degrees of freedom

Number of iterations to convergence: 18 
Achieved convergence tolerance: 1.49e-08


$Goodness
       MSE     RMSE   Rsquare adj.Rsquare      MAE     MAPE     RASE      AIC
1 344662.5 587.0797 0.9491095   0.9363869 442.1638 6.578955 0.252665 177.4702
       BIC
1 177.4702

$Data
   age ageclass   ax   predict
1    1        I 8283 8691.1232
2    2       II 5238 3629.4310
3    3      III 1921 2177.7043
4    4       IV 1425 1515.6579
5    5        V  926 1144.2318
6    6       VI  659  909.4138
7    7      VII  479  748.8969
8    8     VIII  228  632.9419
9    9       IX   57  545.6597
10  10        X   24  477.8336
11  11       XI   10  423.7700

> library(ggplot2)
> psdnls.p<-ggplot()+geom_bar(aes(x=age,y=ax,group=ageclass),data=psd_D2$Data,stat = "identity")+
+   geom_line(aes(x=age,y=predict),color="blue",linewidth=1,data=psd_D2$Data)+
+   geom_text(aes(x=10,y=7700),label=expression(paste(italic(y),"=aexp(-b",italic(x),")")))+
+   geom_text(aes(x=10,y=7300),label=expression(paste(R^2,"=0.987")))+
+   scale_x_continuous(breaks=1:11)+
+   scale_x_discrete(limits=psd_D2$Data$ageclass)+
+   xlab("Age class")+ylab("Number of individuals")
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
> psdnls.p
Error in `geom_text()`:
! Problem while setting up geom aesthetics.
ℹ Error occurred in the 3rd layer.
Caused by error in `list_sizes()`:
! `x$label` must be a vector, not an expression vector.
Backtrace:
     ▆
  1. ├─base (local) `<fn>`(x)
  2. ├─ggplot2 (local) `print.ggplot2::ggplot`(x)
  3. │ ├─ggplot2::ggplot_build(x)
  4. │ └─ggplot2 (local) `ggplot_build.ggplot2::ggplot`(x)
  5. │   └─ggplot2:::by_layer(...)
  6. │     ├─rlang::try_fetch(...)
  7. │     │ ├─base::tryCatch(...)
  8. │     │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. │     │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10. │     │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 11. │     │ └─base::withCallingHandlers(...)
 12. │     └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. │       └─l$compute_geom_2(d, theme = plot@theme)
 14. │         └─ggplot2 (local) compute_geom_2(..., self = self)
 15. │           └─self$geom$use_defaults(...)
 16. │             └─ggplot2 (local) use_defaults(..., self = self)
 17. │               └─ggplot2:::check_aesthetics(new_params, nrow(data))
 18. │                 └─vctrs::list_sizes(x)
 19. └─vctrs:::stop_scalar_type(`<fn>`(`<expression>`), "x$label", `<env>`)
 20.   └─vctrs:::stop_vctrs(...)
 21.     └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
Execution halted