-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small inconsistency between [<-
methods for matter_arr and array
#6
Comments
Another small inconsistency: the suppressPackageStartupMessages(library(matter))
array <- array(1:8, dim = c(2, 2, 2))
matter <- matter_arr(array, dim = dim(array))
# base: Returns empty array of appropriate dimension
array[NULL, NULL, NULL]
#> <0 x 0 x 0 array of integer>
#>
# matter: errors
matter[NULL, NULL, NULL]
#> Error in matter[NULL, NULL, NULL]: incorrect number of dimensions
# base: Returns empty array of appropriate dimension
array[NULL, NULL, 1]
#> <0 x 0 matrix>
# matter: errors
matter[NULL, NULL, 1]
#> Error in matter[NULL, NULL, 1]: incorrect number of dimensions
# base: Returns empty array of appropriate dimension
array[NULL, , NULL]
#> <0 x 2 x 0 array of integer>
#> [,1] [,2]
# matter: errors
matter[NULL, , NULL]
#> Error in FUN(if (length(d.call) < 2L) newX[, 1] else array(newX[, 1L], : subscript out of bounds Session infodevtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R Under development (unstable) (2017-12-12 r73903)
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate en_AU.UTF-8
#> tz Australia/Melbourne
#> date 2017-12-27
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
#> base * 3.5.0 2017-12-13 local
#> biglm * 0.9-1 2013-05-16 CRAN (R 3.5.0)
#> BiocGenerics 0.25.1 2017-12-17 Bioconductor
#> compiler 3.5.0 2017-12-13 local
#> datasets * 3.5.0 2017-12-13 local
#> DBI * 0.7 2017-06-18 CRAN (R 3.5.0)
#> devtools 1.13.4 2017-11-09 CRAN (R 3.5.0)
#> digest 0.6.13 2017-12-14 CRAN (R 3.5.0)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.5.0)
#> graphics * 3.5.0 2017-12-13 local
#> grDevices * 3.5.0 2017-12-13 local
#> grid 3.5.0 2017-12-13 local
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.5.0)
#> irlba 2.3.1 2017-10-18 CRAN (R 3.5.0)
#> knitr 1.17 2017-08-10 CRAN (R 3.5.0)
#> lattice 0.20-35 2017-03-25 CRAN (R 3.5.0)
#> magrittr 1.5 2014-11-22 CRAN (R 3.5.0)
#> Matrix 1.2-12 2017-11-20 CRAN (R 3.5.0)
#> matter * 1.5.4 2017-12-04 Bioconductor
#> memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
#> methods * 3.5.0 2017-12-13 local
#> parallel 3.5.0 2017-12-13 local
#> Rcpp 0.12.14 2017-11-23 CRAN (R 3.5.0)
#> rmarkdown 1.8 2017-11-17 CRAN (R 3.5.0)
#> rprojroot 1.3-1 2017-12-18 CRAN (R 3.5.0)
#> stats * 3.5.0 2017-12-13 local
#> stringi 1.1.6 2017-11-17 CRAN (R 3.5.0)
#> stringr 1.2.0 2017-02-18 CRAN (R 3.5.0)
#> tools 3.5.0 2017-12-13 local
#> utils * 3.5.0 2017-12-13 local
#> withr 2.1.1 2017-12-19 CRAN (R 3.5.0)
#> yaml 2.1.16 2017-12-12 CRAN (R 3.5.0) |
Sorry, another corner case: the suppressPackageStartupMessages(library(matter))
array <- array(1:8, dim = c(2, 2, 2))
matter <- matter_arr(array)
# base: Returns an array of appropriate dimension
array[integer(0), integer(0), integer(0)]
#> <0 x 0 x 0 array of integer>
#>
# matter: errors
matter[integer(0), integer(0), integer()]
#> Error in FUN(if (length(d.call) < 2L) newX[, 1] else array(newX[, 1L], : subscript out of bounds
# base: Returns an array (I don't quite understand the dimensions)
array[integer(0), 1, integer(0)]
#> <0 x 0 matrix>
# matter: errors
matter[1, 1, integer(0)]
#> Error in FUN(if (length(d.call) < 2L) newX[, 1] else array(newX[, 1L], : subscript out of bounds Session infodevtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R Under development (unstable) (2017-12-12 r73903)
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate en_AU.UTF-8
#> tz Australia/Melbourne
#> date 2017-12-27
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
#> base * 3.5.0 2017-12-13 local
#> biglm * 0.9-1 2013-05-16 CRAN (R 3.5.0)
#> BiocGenerics 0.25.1 2017-12-17 Bioconductor
#> compiler 3.5.0 2017-12-13 local
#> datasets * 3.5.0 2017-12-13 local
#> DBI * 0.7 2017-06-18 CRAN (R 3.5.0)
#> devtools 1.13.4 2017-11-09 CRAN (R 3.5.0)
#> digest 0.6.13 2017-12-14 CRAN (R 3.5.0)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.5.0)
#> graphics * 3.5.0 2017-12-13 local
#> grDevices * 3.5.0 2017-12-13 local
#> grid 3.5.0 2017-12-13 local
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.5.0)
#> irlba 2.3.1 2017-10-18 CRAN (R 3.5.0)
#> knitr 1.17 2017-08-10 CRAN (R 3.5.0)
#> lattice 0.20-35 2017-03-25 CRAN (R 3.5.0)
#> magrittr 1.5 2014-11-22 CRAN (R 3.5.0)
#> Matrix 1.2-12 2017-11-20 CRAN (R 3.5.0)
#> matter * 1.5.4 2017-12-04 Bioconductor
#> memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
#> methods * 3.5.0 2017-12-13 local
#> parallel 3.5.0 2017-12-13 local
#> Rcpp 0.12.14 2017-11-23 CRAN (R 3.5.0)
#> rmarkdown 1.8 2017-11-17 CRAN (R 3.5.0)
#> rprojroot 1.3-1 2017-12-18 CRAN (R 3.5.0)
#> stats * 3.5.0 2017-12-13 local
#> stringi 1.1.6 2017-11-17 CRAN (R 3.5.0)
#> stringr 1.2.0 2017-02-18 CRAN (R 3.5.0)
#> tools 3.5.0 2017-12-13 local
#> utils * 3.5.0 2017-12-13 local
#> withr 2.1.1 2017-12-19 CRAN (R 3.5.0)
#> yaml 2.1.16 2017-12-12 CRAN (R 3.5.0) |
These should behave more as expected in version >= 1.9.8, with the exception that subsetting a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Kylie,
The
[<-
replacement method seems to work the same for base::matrix and matter_mat objects, but not so for base::array and matter_arr objects. An example is shown below. Is this fixable? I hit this when using programatically constructed indices passed to the[<-
method for the matter_arr class via ado.call()
.The text was updated successfully, but these errors were encountered: