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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: RealInt
> ### Title: US Ex-post Real Interest Rate
> ### Aliases: RealInt
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ## load and plot data
> data("RealInt")
> plot(RealInt)
> 
> ## estimate breakpoints
> bp.ri <- breakpoints(RealInt ~ 1, h = 15)
> plot(bp.ri)
> summary(bp.ri)

	 Optimal (m+1)-segment partition: 

Call:
breakpoints.matrix(obj = X, y = y, h = h, breaks = breaks, hpc = hpc)

Breakpoints at observation number:
                      
m = 1               79
m = 2         47    79
m = 3      24 47    79
m = 4      24 47 64 79
m = 5   16 31 47 64 79

Corresponding to breakdates:
                                               
m = 1                                   1980(3)
m = 2                   1972(3)         1980(3)
m = 3           1966(4) 1972(3)         1980(3)
m = 4           1966(4) 1972(3) 1976(4) 1980(3)
m = 5   1964(4) 1968(3) 1972(3) 1976(4) 1980(3)

Fit:
                                                                
m    0         1         2         3         4         5        
RSS  1.215e+03 6.450e+02 4.560e+02 4.452e+02 4.449e+02 4.496e+02
BIC  5.557e+02 4.998e+02 4.733e+02 4.801e+02 4.893e+02 4.997e+02
LWZ  5.614e+02 5.112e+02 4.905e+02 5.030e+02 5.179e+02 5.339e+02
R.sq 9.902e-33 4.691e-01 6.247e-01 6.336e-01 6.338e-01 6.299e-01
> 
> ## fit segmented model with three breaks
> fac.ri <- breakfactor(bp.ri, breaks = 3, label = "seg")
> fm.ri <- lm(RealInt ~ 0 + fac.ri)
> summary(fm.ri)

Call:
lm(formula = RealInt ~ 0 + fac.ri)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.5157 -1.3674 -0.0578  1.3248  6.0990 

Coefficients:
           Estimate Std. Error t value Pr(>|t|)    
fac.riseg1   1.8236     0.4329   4.213 5.57e-05 ***
fac.riseg2   0.8661     0.4422   1.959    0.053 .  
fac.riseg3  -1.7961     0.3749  -4.791 5.83e-06 ***
fac.riseg4   5.6429     0.4329  13.036  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.121 on 99 degrees of freedom
Multiple R-squared:  0.6842,	Adjusted R-squared:  0.6714 
F-statistic: 53.62 on 4 and 99 DF,  p-value: < 2.2e-16

> 
> ## setup kernel HAC estimator
> vcov.ri <- function(x, ...) kernHAC(x, kernel = "Quadratic Spectral",
+   prewhite = 1, approx = "AR(1)", ...)
> 
> ## Results from Table 1 in Bai & Perron (2003):
> ## coefficient estimates
> coef(bp.ri, breaks = 3)
                  (Intercept)
1961(1) - 1966(4)   1.8236167
1967(1) - 1972(3)   0.8660848
1972(4) - 1980(3)  -1.7961384
1980(4) - 1986(3)   5.6428896
> ## corresponding standard errors
> sapply(vcov(bp.ri, breaks = 3, vcov = vcov.ri), sqrt)
Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action,  : 
  non-conformable arguments
Error in meatHAC(x, order.by = order.by, prewhite = prewhite, weights = weights,  : 
  VAR(1) prewhitening of estimating functions failed
Calls: sapply ... vcov. -> kernHAC -> vcovHAC -> vcovHAC.default -> meatHAC
Execution halted