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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: as.prop.table
> ### Title: Convert a crosstable to a frequency or a propensity table
> ### Aliases: as.prop.table as.prop.table.datawizard_crosstab
> ###   as.data.frame.datawizard_tables as.table.datawizard_table
> 
> ### ** Examples
> 
> data(efc)
> 
> # Some cross tabulation
> cross <- data_tabulate(efc, select = "e42dep", by = "c172code", proportions = "row")
> cross
e42dep | low level of education | intermediate level of education
-------+------------------------+--------------------------------
1      |              0  (0.0%) |                      2 (100.0%)
2      |              0  (0.0%) |                      4 (100.0%)
3      |              4 (14.3%) |                     16  (57.1%)
4      |              4  (6.3%) |                     42  (66.7%)
<NA>   |              0  (0.0%) |                      2  (66.7%)
-------+------------------------+--------------------------------
Total  |                      8 |                              66

e42dep | high level of education |      <NA> | Total
-------+-------------------------+-----------+------
1      |               0  (0.0%) | 0  (0.0%) |     2
2      |               0  (0.0%) | 0  (0.0%) |     4
3      |               6 (21.4%) | 2  (7.1%) |    28
4      |              10 (15.9%) | 7 (11.1%) |    63
<NA>   |               0  (0.0%) | 1 (33.3%) |     3
-------+-------------------------+-----------+------
Total  |                      16 |        10 |   100
> 
> # Convert to a propensity table
> as.prop.table(cross)
Removing NA values from frequency table.
[[1]]
  low level of education intermediate level of education
1             0.00000000                      1.00000000
2             0.00000000                      1.00000000
3             0.14285714                      0.57142857
4             0.06349206                      0.66666667
  high level of education
1              0.00000000
2              0.00000000
3              0.21428571
4              0.15873016

> 
> # Convert to data.frame
> result <- data_tabulate(efc, "c172code", by = "e16sex")
> as.data.frame(result)
       var        table
1 c172code c(1, 2, ....
> as.data.frame(result)$table
[[1]]
  c172code male female NA
1        1    5      3  0
2        2   32     34  0
3        3    4     12  0
4     <NA>    5      5  0

> as.data.frame(result, add_total = TRUE)$table
[[1]]
  c172code male female <NA> Total
1        1    5      3    0     8
2        2   32     34    0    66
3        3    4     12    0    16
4     <NA>    5      5    0    10
5    Total   46     54    0   100

> 
> # Convert to a table that can be passed to chisq.test()
> 
> out <- data_tabulate(efc, "c172code", by = "e16sex")
> # we need to simplify the output, else we get a list of tables
> tbl <- as.table(out, simplify = TRUE)
Removing NA values from frequency table.
> tbl
  male female
1    5      3
2   32     34
3    4     12
> suppressWarnings(chisq.test(tbl))

	Pearson's Chi-squared test

data:  tbl
X-squared = 3.8802, df = 2, p-value = 0.1437

> 
> # apply chisq.test to each table
> out <- data_tabulate(efc, c("c172code", "e16sex"))
Error in as.data.frame.integer(x[[i]], optional = TRUE) : 
  row names contain missing values
Calls: data_tabulate ... data.frame -> as.data.frame -> as.data.frame.integer
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
        user system elapsed
adjust 5.505  0.331   6.007