Comments (3)
These should behave more as expected in version >= 1.9.8, with the exception that subsetting a matter_arr
always produces an array
and never a matrix
.
from matter.
Another small inconsistency: the [<-
method for base::array supports NULL
indices but the method for matter does not:
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 info
devtools::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)
from matter.
Sorry, another corner case: the [<-
method for base::array supports integer(0)
indices but the method for matter does not:
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 info
devtools::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)
from matter.
Related Issues (20)
- Looking forward to a vignette HOT 1
- binding of matters from different files doesnt work properly HOT 1
- argument data is missing with no default HOT 4
- On the operation of sparse matrices in high-throughput data HOT 2
- Installation fails with version 2.2.0, from Bioconductor and from github HOT 1
- matter::sparse_mat path HOT 1
- Add support for complete Ops group generic for `matter_arr` HOT 2
- Support multiple channels for image processing functions
- Adaptive bilateral filter is too adaptive HOT 1
- Simulating images
- Add support for Ops generics for `drle`
- Add local maxima detection for multidimensional signals HOT 1
- Estimate noise functions should ignore peak windows HOT 1
- Add unit tests for visualization HOT 2
- `if` missing closing '}' HOT 1
- `to_raster()` fails for non-gridded character rasters HOT 2
- Add noise estimation for multidimensional signals HOT 1
- Add `serialize = TRUE` option to chunk apply functions HOT 1
- `nchunks` calculated wrongly from `chunksize` if `depends != NULL` HOT 3
- Parallel functionals in `rowDists()` and `rowStats()` are leaky HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matter.