metrumresearchgroup/metrumrg

Recycling array of length 1 in array-vector arithmetic is deprecated.

kylebaron opened this issue · 1 comments

https://cran.r-project.org/doc/manuals/r-release/NEWS.html
Changes in 3.4.0:

Arithmetic between length-1 arrays and longer non-arrays had silently dropped the array attributes and recycled. This now gives a warning and will signal an error in the future, as it has always for logic and comparison operations in these cases (e.g., compare matrix(1,1) + 2:3 and matrix(1,1) < 2:3).

This shows up when running simpar with 3.4.x:

sims <- simpar(nsim=1000,
               theta=theta,
               covar=cov,
               omega = omega[[1]],
               odf = 70, 
               sigma = list(matrix(0)),
               sdf = 70)

with warning message:

Warning message:
In df * cov/rchisq(n, df) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Note that it will be an error "in the future".

session_info

devtools::session_info()
Session info -----------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.1 (2017-06-30)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.0.143)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/Chicago             
 date     2017-07-26                  

Packages ---------------------------------------------------------------------------------------------------------------------------
 package       * version     date       source                                       
 assertthat      0.2.0       2017-04-11 CRAN (R 3.4.0)                               
 base          * 3.4.1       2017-07-07 local                                        
 bindr           0.1         2016-11-13 CRAN (R 3.4.0)                               
 bindrcpp      * 0.2         2017-06-17 cran (@0.2)                                  
 compiler        3.4.1       2017-07-07 local                                        
 datasets      * 3.4.1       2017-07-07 local                                        
 devtools        1.13.2      2017-06-02 CRAN (R 3.4.0)                               
 digest          0.6.12      2017-01-27 CRAN (R 3.4.0)                               
 dplyr         * 0.7.1       2017-06-22 CRAN (R 3.4.0)                               
 glue            1.1.1       2017-06-21 CRAN (R 3.4.0)                               
 graphics      * 3.4.1       2017-07-07 local                                        
 grDevices     * 3.4.1       2017-07-07 local                                        
 grid            3.4.1       2017-07-07 local                                        
 hms             0.3         2016-11-22 CRAN (R 3.4.0)                               
 lattice         0.20-35     2017-03-25 CRAN (R 3.4.1)                               
 lazyeval        0.2.0       2016-06-12 CRAN (R 3.4.0)                               
 magrittr        1.5         2014-11-22 CRAN (R 3.4.0)                               
 MASS            7.3-47      2017-02-26 CRAN (R 3.4.1)                               
 memoise         1.1.0       2017-04-21 CRAN (R 3.4.0)                               
 methods       * 3.4.1       2017-07-07 local                                        
 metrumrg        5.57        2017-06-20 Github (metrumresearchgroup/metrumrg@2e5a541)
 mrgsolve      * 0.8.6.9000  2017-07-26 local                                        
 pkgconfig       2.0.1       2017-03-21 CRAN (R 3.4.0)                               
 plyr            1.8.4       2016-06-08 CRAN (R 3.4.0)                               
 R6              2.2.2       2017-06-17 CRAN (R 3.4.0)                               
 Rcpp            0.12.12     2017-07-15 CRAN (R 3.4.0)                               
 RcppArmadillo   0.7.900.2.0 2017-06-04 CRAN (R 3.4.0)                               
 readr         * 1.1.1       2017-05-16 cran (@1.1.1)                                
 reshape         0.8.6       2016-10-21 CRAN (R 3.4.0)                               
 rlang           0.1.1       2017-05-18 CRAN (R 3.4.0)                               
 stats         * 3.4.1       2017-07-07 local                                        
 tibble          1.3.3       2017-05-28 CRAN (R 3.4.0)                               
 tools           3.4.1       2017-07-07 local                                        
 utils         * 3.4.1       2017-07-07 local                                        
 withr           1.0.2       2016-06-20 CRAN (R 3.4.0)                               
 XML             3.98-1.9    2017-06-19 CRAN (R 3.4.0)    

In the example, cov is a 1x1 matrix, df is integer (degrees of freedom), and n=1000.