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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: vario.reg.prep
> ### Title: Adjustment for covariates
> ### Aliases: vario.reg.prep
> 
> ### ** Examples
> 
> ## Example 1
> head(birth) #geo-coded dataset
           x           y birthweight primiparous datediff bmi weight inc
1  2760.9530 -2246.30033    3249.693           1       14  23     76   4
2  -747.2682   -16.16918    2429.693           1       22  18     54   4
3 -1609.2821 -3590.09266    3279.693           1       -7  20     59   3
4  8935.2757 -1157.91136    3479.693           1       -1  32    110   3
5 -2258.1243  3226.65995    3569.693           1       -6  23     71   4
6 -6015.6184 -6122.37746    3689.693           0        7  24     75   2
> hist(birth$birthweight) # attribute of interest
> 
> # Linear regression model
> mod1 = lm(birthweight ~ primiparous + datediff + bmi
+ + factor(inc), data = birth)
> summary(mod1)

Call:
lm(formula = birthweight ~ primiparous + datediff + bmi + factor(inc), 
    data = birth)

Residuals:
    Min      1Q  Median      3Q     Max 
-999.92 -272.80   -9.58  255.36 1344.33 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  3301.157     74.219  44.479  < 2e-16 ***
primiparous  -104.613     28.516  -3.669 0.000258 ***
datediff      -23.814      1.443 -16.506  < 2e-16 ***
bmi             7.532      2.526   2.982 0.002942 ** 
factor(inc)1  -34.272     60.922  -0.563 0.573874    
factor(inc)2   82.518     52.961   1.558 0.119568    
factor(inc)3  107.574     50.420   2.134 0.033152 *  
factor(inc)4  109.153     52.337   2.086 0.037299 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 413.9 on 895 degrees of freedom
Multiple R-squared:  0.2577,	Adjusted R-squared:  0.2519 
F-statistic: 44.38 on 7 and 895 DF,  p-value: < 2.2e-16

> data.adj1 = vario.reg.prep(mod1)
Message:
 Are the columns in the dataset used for regression in correct order?
  Data interpretation:
    column 1: Cartesian x-coordinates in meters
    column 2: Cartesian y-coordinates in meters
    column 3: variable of interest
    further columns: covariates 
 

> 
> head(data.adj1)
           x           y        adj
1  2760.9530 -2246.30033  0.2525432
2  -747.2682   -16.16918 -1.1853623
3 -1609.2821 -3590.09266 -0.8281595
4  8935.2757 -1157.91136 -0.2165357
5 -2258.1243  3226.65995 -0.1263259
6 -6015.6184 -6122.37746  0.7070596
> hist(data.adj1$adj) # adjusted attribute of interest
> # The data frame can be used as input for the vario.mod function.
> 
> 
> ## Example 2
> # Data argument within lm not provided (not recommended, but possible):
> mod2 = lm(birth$birthweight ~ birth$primiparous + birth$datediff + birth$bmi
+ + factor(birth$inc))
> summary(mod2)

Call:
lm(formula = birth$birthweight ~ birth$primiparous + birth$datediff + 
    birth$bmi + factor(birth$inc))

Residuals:
    Min      1Q  Median      3Q     Max 
-999.92 -272.80   -9.58  255.36 1344.33 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)        3301.157     74.219  44.479  < 2e-16 ***
birth$primiparous  -104.613     28.516  -3.669 0.000258 ***
birth$datediff      -23.814      1.443 -16.506  < 2e-16 ***
birth$bmi             7.532      2.526   2.982 0.002942 ** 
factor(birth$inc)1  -34.272     60.922  -0.563 0.573874    
factor(birth$inc)2   82.518     52.961   1.558 0.119568    
factor(birth$inc)3  107.574     50.420   2.134 0.033152 *  
factor(birth$inc)4  109.153     52.337   2.086 0.037299 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 413.9 on 895 degrees of freedom
Multiple R-squared:  0.2577,	Adjusted R-squared:  0.2519 
F-statistic: 44.38 on 7 and 895 DF,  p-value: < 2.2e-16

> # In this case, make sure to provide the data argument here:
> data.adj2 = vario.reg.prep(reg = mod2, data = birth)
Message:
 Are the columns in the dataset used for regression in correct order?
  Data interpretation:
    column 1: Cartesian x-coordinates in meters
    column 2: Cartesian y-coordinates in meters
    column 3: variable of interest
    further columns: covariates 
 

> 
> 
> ## Example 3
> # Linear mixed regression model
> library(lme4)
Error in library(lme4) : there is no package called ‘lme4’
Execution halted