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

> ### Name: Q.map.test
> ### Title: Compute the QE and QI tests of Equivalence and Independence
> ###   between maps
> ### Aliases: Q.map.test
> 
> ### ** Examples
> 
> 
> # Case 1:
> N <- 200
> cx <- runif(N)
> cy <- runif(N)
> x <- cbind(cx,cy)
> listw <- spdep::nb2listw(spdep::knn2nb(
+            spdep::knearneigh(cbind(cx,cy), k = 4)))
> p <- c(1/6, 3/6, 2/6)
> rho = 0.5
> QY1 <- dgp.spq(p = p, listw = listw, rho = rho)
> rho = 0.8
> QY2 <- dgp.spq(p = p, listw = listw, rho = rho)
> dt = data.frame(QY1,QY2)
> m = 3
> r = 1
> formula <- ~ QY1 + QY2
> control <- list(dtmaxknn = 10)
> qmap <- Q.map.test(formula = formula, data = dt, coor = x, m = m, r = r,
+                    type ="combinations", control = control)
> print(qmap)
[[1]]

	Q-Map test of Equivalence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9

data:  QY1 and QY2
QE = 263.73, df = 9, p-value < 2.2e-16
alternative hypothesis: two.sided


[[2]]

	Q-Map test of Independence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9

data:  QY1 and QY2
QI = 76.386, df = 81, p-value = 0.6244
alternative hypothesis: two.sided


attr(,"class")
[1] "qmap" "list"
> plot(qmap)
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
> plot(qmap, ci=.6)
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
> plot(qmap[[1]]$mh)
> summary(qmap[[1]]$mh)

Characteristics of m-surrounding:

Number of m-surrounding (R): 90
Length of m-surrounding (m): 3
Number no-symbolized observations: 12

List of no-symbolized observations:
8 62 66 69 80 85 117 122 130 146 191 199

List of the degree overlaping:
    There are 2 m-surrounding that have intersection with 0 m-surrounding
    There are 12 m-surrounding that have intersection with 1 m-surrounding
    There are 76 m-surrounding that have intersection with 2 m-surrounding
Mean degree of overlaping: 1.8222
> 
> control <- list(dtmaxknn = 20)
> qmap <- Q.map.test(formula = formula, data = dt, coor = x, m = m, r = r,
+                    type ="permutations", control = control)
Warning in Q.map.test(formula = formula, data = dt, coor = x, m = m, r = r,  :
  The ratio between the number of symbolized observations and the number of symbols is lower than 5.
> print(qmap)
[[1]]

	Q-Map test of Equivalence for qualitative data.
	
	Symbols type: permutations
	
	Ratio Symbolized observations/Num symbols = 3.44

data:  QY1 and QY2
QE = 290.31, df = 26, p-value < 2.2e-16
alternative hypothesis: two.sided


[[2]]

	Q-Map test of Independence for qualitative data.
	
	Symbols type: permutations
	
	Ratio Symbolized observations/Num symbols = 3.44

data:  QY1 and QY2
QI = 260.11, df = 676, p-value = 1
alternative hypothesis: two.sided


attr(,"class")
[1] "qmap" "list"
> plot(qmap)
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
> plot(qmap[[1]]$mh)
> qmap <- Q.map.test(formula = formula, data = dt, coor = x, m = m, r = r,
+                    type ="combinations")
> print(qmap)
[[1]]

	Q-Map test of Equivalence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9.9

data:  QY1 and QY2
QE = 289.69, df = 9, p-value < 2.2e-16
alternative hypothesis: two.sided


[[2]]

	Q-Map test of Independence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9.9

data:  QY1 and QY2
QI = 82.811, df = 81, p-value = 0.4233
alternative hypothesis: two.sided


attr(,"class")
[1] "qmap" "list"
> plot(qmap)
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
> control <- list(dtmaxknn = 10)
> qmap <- Q.map.test(formula = formula, data = dt, coor = x, m = m, r = r,
+                    type ="combinations", control = control)
> print(qmap)
[[1]]

	Q-Map test of Equivalence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9

data:  QY1 and QY2
QE = 263.73, df = 9, p-value < 2.2e-16
alternative hypothesis: two.sided


[[2]]

	Q-Map test of Independence for qualitative data.
	
	Symbols type: combinations
	
	Ratio Symbolized observations/Num symbols = 9

data:  QY1 and QY2
QI = 76.386, df = 81, p-value = 0.6244
alternative hypothesis: two.sided


attr(,"class")
[1] "qmap" "list"
> plot(qmap)
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
Warning: Use of `data$symb` is discouraged.
ℹ Use `symb` instead.
> 
> # Case 2:
> data(provinces_spain)
> # sf::sf_use_s2(FALSE)
> m = 3
> r = 1
> 
> provinces_spain$Mal2Fml <- factor(provinces_spain$Mal2Fml > 100)
> levels(provinces_spain$Mal2Fml) = c("men","woman")
> provinces_spain$Coast <- factor(provinces_spain$Coast)
> levels(provinces_spain$Coast) = c("no","yes")
> formula <- ~ Coast + Mal2Fml
> qmap <- Q.map.test(formula = formula, data = provinces_spain, m = m, r = r,
+                    type ="combinations")
Error in UseMethod("units") : 
  no applicable method for 'units' applied to an object of class "NULL"
Calls: Q.map.test -> m.surround -> rbind -> rbind -> units
Execution halted