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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: table2spreadsheet
> ### Title: Export statistical output to a table in spreadsheet compatible
> ###   format (.xlsx or .csv)
> ### Aliases: table2spreadsheet table2excel table2csv table2csv2 table2excel
> ###   table2csv table2csv2
> 
> ### ** Examples
> 
> # Create a file name
> filen <- tempfile(pattern = "table_aov") # or 
> # filen <- paste("YOUR_DIR/table_aov")
> 
> # Generate ANOVA output
> fit=aov(yield ~ block + N * P + K, data = npk) # 'npk' dataset from base 'datasets'
> x=summary(fit)
> 
> # Save ANOVA table as a CSV
> ### Option 1: pass output as object
> table2csv(x=x,file=filen, digits = 1, digitspvals = 3)
Exported table as /home/hornik/tmp/scratch/RtmpBSJ0Bm/table_aov2a046b6f088d.csv
            Df Sum Sq Mean Sq F value Pr(>F)
block        5  343.3    68.7     4.4  0.013
N            1  189.3   189.3    12.1  0.004
P            1    8.4     8.4     0.5  0.476
K            1   95.2    95.2     6.1  0.027
N:P          1   21.3    21.3     1.4  0.263
Residuals   14  218.9    15.6      NA   <NA>
> ### Option 2: get output from console 
> summary(fit)
            Df Sum Sq Mean Sq F value  Pr(>F)   
block        5  343.3   68.66   4.391 0.01295 * 
N            1  189.3  189.28  12.106 0.00368 **
P            1    8.4    8.40   0.537 0.47564   
K            1   95.2   95.20   6.089 0.02711 * 
N:P          1   21.3   21.28   1.361 0.26284   
Residuals   14  218.9   15.64                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> table2csv(file=filen, digits = 2, digitspvals = 4)
Exported table as /home/hornik/tmp/scratch/RtmpBSJ0Bm/table_aov2a046b6f088d.csv
            Df Sum Sq Mean Sq F value Pr(>F)
block        5 343.29   68.66    4.39 0.0130
N            1 189.28  189.28   12.11 0.0037
P            1   8.40    8.40    0.54 0.4756
K            1  95.20   95.20    6.09 0.0271
N:P          1  21.28   21.28    1.36 0.2628
Residuals   14 218.90   15.64      NA   <NA>
> 
> # Save ANOVA table as an Excel
> # Without formatting of the worksheet
> x
            Df Sum Sq Mean Sq F value  Pr(>F)   
block        5  343.3   68.66   4.391 0.01295 * 
N            1  189.3  189.28  12.106 0.00368 **
P            1    8.4    8.40   0.537 0.47564   
K            1   95.2   95.20   6.089 0.02711 * 
N:P          1   21.3   21.28   1.361 0.26284   
Residuals   14  218.9   15.64                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> table2excel(file=filen, sheetName="aov_noformatting", 
+             digits = 1, digitspvals = 3) 
Error in .Call(`_openxlsx_write_file`, head, body, tail, fl) : 
  WEIRD RETURN VALUE: (nil)
Calls: table2excel ... table2spreadsheet -> saveWorkbook -> <Anonymous> -> write_file
Execution halted