| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-28 11:38 -0500 (Fri, 28 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4866 |
| lconway | macOS 12.7.6 Monterey | x86_64 | R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" | 4614 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4571 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 252/2328 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-11-27 20:33:17 -0500 (Thu, 27 Nov 2025) |
| EndedAt: 2025-11-27 20:34:08 -0500 (Thu, 27 Nov 2025) |
| EllapsedTime: 51.7 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-21 r88958)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.336 0.153 0.513
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481268 25.8 1058102 56.6 NA 633897 33.9
Vcells 891509 6.9 8388608 64.0 98304 2110436 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Nov 27 20:33:43 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 27 20:33:43 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x600003704120>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Nov 27 20:33:47 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 27 20:33:49 2025"
>
> ColMode(tmp2)
<pointer: 0x600003704120>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.0202477 0.9296322 -0.4174622 1.3091816
[2,] -1.3777380 -0.6421821 -1.8739359 -0.9616183
[3,] -0.3650596 -0.6424391 2.0678882 1.0602471
[4,] 0.1337968 0.6182978 1.1229096 0.1420333
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.0202477 0.9296322 0.4174622 1.3091816
[2,] 1.3777380 0.6421821 1.8739359 0.9616183
[3,] 0.3650596 0.6424391 2.0678882 1.0602471
[4,] 0.1337968 0.6182978 1.1229096 0.1420333
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0010123 0.9641744 0.6461132 1.1441947
[2,] 1.1737708 0.8013627 1.3689178 0.9806214
[3,] 0.6042017 0.8015230 1.4380154 1.0296830
[4,] 0.3657825 0.7863191 1.0596743 0.3768730
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.03037 35.57138 31.87859 37.75113
[2,] 38.11545 33.65581 40.56311 35.76783
[3,] 31.40708 33.65767 41.44804 36.35708
[4,] 28.79162 33.48149 36.71965 28.91076
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003774000>
> exp(tmp5)
<pointer: 0x600003774000>
> log(tmp5,2)
<pointer: 0x600003774000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.3712
> Min(tmp5)
[1] 55.04485
> mean(tmp5)
[1] 73.56692
> Sum(tmp5)
[1] 14713.38
> Var(tmp5)
[1] 856.2213
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.30864 74.40621 69.94864 68.92250 70.70119 70.87359 72.56163 73.59210
[9] 69.92525 73.42947
> rowSums(tmp5)
[1] 1826.173 1488.124 1398.973 1378.450 1414.024 1417.472 1451.233 1471.842
[9] 1398.505 1468.589
> rowVars(tmp5)
[1] 7948.16879 62.59846 60.57199 72.86729 83.82171 67.21270
[7] 81.54727 63.78086 68.23521 59.09908
> rowSd(tmp5)
[1] 89.152503 7.911919 7.782801 8.536234 9.155420 8.198335 9.030353
[8] 7.986292 8.260460 7.687593
> rowMax(tmp5)
[1] 468.37123 93.45040 86.26867 87.47896 90.13507 86.24731 88.86942
[8] 92.05143 86.80545 86.49137
> rowMin(tmp5)
[1] 55.90012 56.96959 55.04485 57.87490 58.27293 55.44162 56.57762 57.38191
[9] 59.77991 58.03591
>
> colMeans(tmp5)
[1] 111.99134 71.52354 73.63499 69.74250 66.94926 74.99559 70.79357
[8] 70.59706 74.20383 72.93404 72.88997 72.36629 70.73161 69.43298
[15] 69.24402 76.53678 68.90348 72.12025 72.87241 68.87491
> colSums(tmp5)
[1] 1119.9134 715.2354 736.3499 697.4250 669.4926 749.9559 707.9357
[8] 705.9706 742.0383 729.3404 728.8997 723.6629 707.3161 694.3298
[15] 692.4402 765.3678 689.0348 721.2025 728.7241 688.7491
> colVars(tmp5)
[1] 15819.58027 40.58755 87.63709 57.91352 19.51876 34.22155
[7] 79.62980 59.39015 43.73918 41.03206 110.80940 68.02780
[13] 70.30020 58.16624 125.95016 75.15661 106.63227 36.29203
[19] 83.99711 69.79180
> colSd(tmp5)
[1] 125.775913 6.370836 9.361468 7.610093 4.418004 5.849919
[7] 8.923553 7.706501 6.613560 6.405627 10.526604 8.247896
[13] 8.384521 7.626679 11.222752 8.669291 10.326290 6.024287
[19] 9.164994 8.354148
> colMax(tmp5)
[1] 468.37123 79.93368 86.26867 78.85006 71.93139 83.20477 86.07253
[8] 80.39201 86.24731 82.01710 93.45040 86.49137 84.79156 79.72216
[15] 86.80545 87.47896 92.05143 80.80038 86.73942 82.43245
> colMin(tmp5)
[1] 55.44162 59.76862 59.00321 59.38558 58.58529 67.31368 57.30140 58.03591
[9] 64.12241 64.21335 57.87490 61.40976 59.25589 56.96959 56.57762 61.90234
[17] 55.90012 59.68413 56.25502 55.04485
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.30864 74.40621 69.94864 68.92250 70.70119 70.87359 72.56163 73.59210
[9] 69.92525 NA
> rowSums(tmp5)
[1] 1826.173 1488.124 1398.973 1378.450 1414.024 1417.472 1451.233 1471.842
[9] 1398.505 NA
> rowVars(tmp5)
[1] 7948.16879 62.59846 60.57199 72.86729 83.82171 67.21270
[7] 81.54727 63.78086 68.23521 60.45109
> rowSd(tmp5)
[1] 89.152503 7.911919 7.782801 8.536234 9.155420 8.198335 9.030353
[8] 7.986292 8.260460 7.775030
> rowMax(tmp5)
[1] 468.37123 93.45040 86.26867 87.47896 90.13507 86.24731 88.86942
[8] 92.05143 86.80545 NA
> rowMin(tmp5)
[1] 55.90012 56.96959 55.04485 57.87490 58.27293 55.44162 56.57762 57.38191
[9] 59.77991 NA
>
> colMeans(tmp5)
[1] 111.99134 NA 73.63499 69.74250 66.94926 74.99559 70.79357
[8] 70.59706 74.20383 72.93404 72.88997 72.36629 70.73161 69.43298
[15] 69.24402 76.53678 68.90348 72.12025 72.87241 68.87491
> colSums(tmp5)
[1] 1119.9134 NA 736.3499 697.4250 669.4926 749.9559 707.9357
[8] 705.9706 742.0383 729.3404 728.8997 723.6629 707.3161 694.3298
[15] 692.4402 765.3678 689.0348 721.2025 728.7241 688.7491
> colVars(tmp5)
[1] 15819.58027 NA 87.63709 57.91352 19.51876 34.22155
[7] 79.62980 59.39015 43.73918 41.03206 110.80940 68.02780
[13] 70.30020 58.16624 125.95016 75.15661 106.63227 36.29203
[19] 83.99711 69.79180
> colSd(tmp5)
[1] 125.775913 NA 9.361468 7.610093 4.418004 5.849919
[7] 8.923553 7.706501 6.613560 6.405627 10.526604 8.247896
[13] 8.384521 7.626679 11.222752 8.669291 10.326290 6.024287
[19] 9.164994 8.354148
> colMax(tmp5)
[1] 468.37123 NA 86.26867 78.85006 71.93139 83.20477 86.07253
[8] 80.39201 86.24731 82.01710 93.45040 86.49137 84.79156 79.72216
[15] 86.80545 87.47896 92.05143 80.80038 86.73942 82.43245
> colMin(tmp5)
[1] 55.44162 NA 59.00321 59.38558 58.58529 67.31368 57.30140 58.03591
[9] 64.12241 64.21335 57.87490 61.40976 59.25589 56.96959 56.57762 61.90234
[17] 55.90012 59.68413 56.25502 55.04485
>
> Max(tmp5,na.rm=TRUE)
[1] 468.3712
> Min(tmp5,na.rm=TRUE)
[1] 55.04485
> mean(tmp5,na.rm=TRUE)
[1] 73.59649
> Sum(tmp5,na.rm=TRUE)
[1] 14645.7
> Var(tmp5,na.rm=TRUE)
[1] 860.3699
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.30864 74.40621 69.94864 68.92250 70.70119 70.87359 72.56163 73.59210
[9] 69.92525 73.73192
> rowSums(tmp5,na.rm=TRUE)
[1] 1826.173 1488.124 1398.973 1378.450 1414.024 1417.472 1451.233 1471.842
[9] 1398.505 1400.907
> rowVars(tmp5,na.rm=TRUE)
[1] 7948.16879 62.59846 60.57199 72.86729 83.82171 67.21270
[7] 81.54727 63.78086 68.23521 60.45109
> rowSd(tmp5,na.rm=TRUE)
[1] 89.152503 7.911919 7.782801 8.536234 9.155420 8.198335 9.030353
[8] 7.986292 8.260460 7.775030
> rowMax(tmp5,na.rm=TRUE)
[1] 468.37123 93.45040 86.26867 87.47896 90.13507 86.24731 88.86942
[8] 92.05143 86.80545 86.49137
> rowMin(tmp5,na.rm=TRUE)
[1] 55.90012 56.96959 55.04485 57.87490 58.27293 55.44162 56.57762 57.38191
[9] 59.77991 58.03591
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.99134 71.95029 73.63499 69.74250 66.94926 74.99559 70.79357
[8] 70.59706 74.20383 72.93404 72.88997 72.36629 70.73161 69.43298
[15] 69.24402 76.53678 68.90348 72.12025 72.87241 68.87491
> colSums(tmp5,na.rm=TRUE)
[1] 1119.9134 647.5526 736.3499 697.4250 669.4926 749.9559 707.9357
[8] 705.9706 742.0383 729.3404 728.8997 723.6629 707.3161 694.3298
[15] 692.4402 765.3678 689.0348 721.2025 728.7241 688.7491
> colVars(tmp5,na.rm=TRUE)
[1] 15819.58027 43.61215 87.63709 57.91352 19.51876 34.22155
[7] 79.62980 59.39015 43.73918 41.03206 110.80940 68.02780
[13] 70.30020 58.16624 125.95016 75.15661 106.63227 36.29203
[19] 83.99711 69.79180
> colSd(tmp5,na.rm=TRUE)
[1] 125.775913 6.603950 9.361468 7.610093 4.418004 5.849919
[7] 8.923553 7.706501 6.613560 6.405627 10.526604 8.247896
[13] 8.384521 7.626679 11.222752 8.669291 10.326290 6.024287
[19] 9.164994 8.354148
> colMax(tmp5,na.rm=TRUE)
[1] 468.37123 79.93368 86.26867 78.85006 71.93139 83.20477 86.07253
[8] 80.39201 86.24731 82.01710 93.45040 86.49137 84.79156 79.72216
[15] 86.80545 87.47896 92.05143 80.80038 86.73942 82.43245
> colMin(tmp5,na.rm=TRUE)
[1] 55.44162 59.76862 59.00321 59.38558 58.58529 67.31368 57.30140 58.03591
[9] 64.12241 64.21335 57.87490 61.40976 59.25589 56.96959 56.57762 61.90234
[17] 55.90012 59.68413 56.25502 55.04485
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.30864 74.40621 69.94864 68.92250 70.70119 70.87359 72.56163 73.59210
[9] 69.92525 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1826.173 1488.124 1398.973 1378.450 1414.024 1417.472 1451.233 1471.842
[9] 1398.505 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7948.16879 62.59846 60.57199 72.86729 83.82171 67.21270
[7] 81.54727 63.78086 68.23521 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 89.152503 7.911919 7.782801 8.536234 9.155420 8.198335 9.030353
[8] 7.986292 8.260460 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 468.37123 93.45040 86.26867 87.47896 90.13507 86.24731 88.86942
[8] 92.05143 86.80545 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 55.90012 56.96959 55.04485 57.87490 58.27293 55.44162 56.57762 57.38191
[9] 59.77991 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.65813 NaN 74.09862 70.08137 66.39873 74.10364 70.78857
[8] 71.99274 74.38881 73.05357 72.76821 70.79683 69.16940 70.49515
[15] 69.34377 75.68441 68.06848 71.81000 72.38250 68.61062
> colSums(tmp5,na.rm=TRUE)
[1] 1040.9232 0.0000 666.8876 630.7324 597.5886 666.9328 637.0971
[8] 647.9347 669.4993 657.4822 654.9139 637.1715 622.5246 634.4563
[15] 624.0940 681.1597 612.6163 646.2900 651.4425 617.4956
> colVars(tmp5,na.rm=TRUE)
[1] 17645.76779 NA 96.17352 63.86078 18.54899 29.54908
[7] 89.58325 44.89971 48.82166 46.00034 124.49380 48.82045
[13] 51.63187 52.74467 141.58198 76.37771 112.11759 39.74568
[19] 91.79662 77.72997
> colSd(tmp5,na.rm=TRUE)
[1] 132.837373 NA 9.806810 7.991294 4.306854 5.435907
[7] 9.464843 6.700724 6.987249 6.782355 11.157679 6.987163
[13] 7.185532 7.262553 11.898823 8.739434 10.588559 6.304418
[19] 9.581055 8.816460
> colMax(tmp5,na.rm=TRUE)
[1] 468.37123 -Inf 86.26867 78.85006 71.93139 83.20477 86.07253
[8] 80.39201 86.24731 82.01710 93.45040 79.97574 79.25278 79.72216
[15] 86.80545 87.47896 92.05143 80.80038 86.73942 82.43245
> colMin(tmp5,na.rm=TRUE)
[1] 55.44162 Inf 59.00321 59.38558 58.58529 67.31368 57.30140 60.52533
[9] 64.12241 64.21335 57.87490 61.40976 59.25589 56.96959 56.57762 61.90234
[17] 55.90012 59.68413 56.25502 55.04485
>
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col <- 1
> cat(which.row," ",which.col,"\n")
3 1
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> rowVars(tmp5,na.rm=TRUE)
[1] 187.1494 228.6235 225.8152 246.2163 250.8176 434.6936 157.2931 101.4439
[9] 210.0835 139.9259
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 187.1494 228.6235 225.8152 246.2163 250.8176 434.6936 157.2931 101.4439
[9] 210.0835 139.9259
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -5.684342e-14 8.526513e-14 5.684342e-14 -1.136868e-13 5.684342e-14
[6] -2.842171e-14 -1.989520e-13 0.000000e+00 1.421085e-13 -3.410605e-13
[11] 2.842171e-14 -5.684342e-14 0.000000e+00 7.105427e-14 5.684342e-14
[16] 0.000000e+00 -5.684342e-14 0.000000e+00 0.000000e+00 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 17
6 13
4 11
2 20
8 17
10 10
8 4
1 6
1 4
3 8
9 3
9 10
3 16
4 7
6 19
10 9
9 14
10 3
7 16
6 9
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.462741
> Min(tmp)
[1] -2.622744
> mean(tmp)
[1] 0.0816419
> Sum(tmp)
[1] 8.16419
> Var(tmp)
[1] 1.097458
>
> rowMeans(tmp)
[1] 0.0816419
> rowSums(tmp)
[1] 8.16419
> rowVars(tmp)
[1] 1.097458
> rowSd(tmp)
[1] 1.047596
> rowMax(tmp)
[1] 2.462741
> rowMin(tmp)
[1] -2.622744
>
> colMeans(tmp)
[1] 1.14432727 0.34878492 0.89726325 0.50253217 0.71885328 1.35362342
[7] 0.37192921 -2.62274423 2.05452398 -0.30729981 -0.67767967 -0.20165000
[13] -0.09690588 -0.75609705 -1.48514401 0.06858238 -0.08772810 0.66035543
[19] -0.37875920 2.46274053 -0.78598587 -1.23736982 -0.10267061 0.20214338
[25] -1.31078844 -0.80344970 -0.48864627 -1.19335898 1.42074661 0.59465774
[31] 1.60318891 -1.56559155 0.05625618 1.67627287 -1.17154637 -0.66155941
[37] 1.53383400 0.41417486 -1.54723387 -0.64253509 -0.50824221 -0.90908724
[43] 0.46315352 0.48612520 1.18048025 1.18323396 -0.50999727 0.58519784
[49] -0.59786516 0.23251015 -0.31501298 2.34928546 -0.25838090 -2.32121397
[55] 1.32183757 0.39329152 0.66129162 -1.05249742 0.14112762 0.85106992
[61] 0.66645307 -1.75453081 0.15588281 -0.59964812 -0.34598634 0.58983358
[67] 1.18771127 0.31372010 2.11626823 -1.59835591 0.11191282 -0.23464494
[73] -0.56408395 -0.51513037 -1.00138910 -1.05782936 0.16494219 0.97656307
[79] 0.96333458 0.22234863 -1.03387044 1.84807242 0.87981322 1.00766232
[85] -0.19745948 0.67015023 -0.94623282 -0.96263851 0.19087193 1.72932420
[91] -1.49328859 0.70329986 -0.17235284 0.31389489 -0.35702739 -0.81338454
[97] 1.94068097 1.37182285 -0.27643015 0.62755628
> colSums(tmp)
[1] 1.14432727 0.34878492 0.89726325 0.50253217 0.71885328 1.35362342
[7] 0.37192921 -2.62274423 2.05452398 -0.30729981 -0.67767967 -0.20165000
[13] -0.09690588 -0.75609705 -1.48514401 0.06858238 -0.08772810 0.66035543
[19] -0.37875920 2.46274053 -0.78598587 -1.23736982 -0.10267061 0.20214338
[25] -1.31078844 -0.80344970 -0.48864627 -1.19335898 1.42074661 0.59465774
[31] 1.60318891 -1.56559155 0.05625618 1.67627287 -1.17154637 -0.66155941
[37] 1.53383400 0.41417486 -1.54723387 -0.64253509 -0.50824221 -0.90908724
[43] 0.46315352 0.48612520 1.18048025 1.18323396 -0.50999727 0.58519784
[49] -0.59786516 0.23251015 -0.31501298 2.34928546 -0.25838090 -2.32121397
[55] 1.32183757 0.39329152 0.66129162 -1.05249742 0.14112762 0.85106992
[61] 0.66645307 -1.75453081 0.15588281 -0.59964812 -0.34598634 0.58983358
[67] 1.18771127 0.31372010 2.11626823 -1.59835591 0.11191282 -0.23464494
[73] -0.56408395 -0.51513037 -1.00138910 -1.05782936 0.16494219 0.97656307
[79] 0.96333458 0.22234863 -1.03387044 1.84807242 0.87981322 1.00766232
[85] -0.19745948 0.67015023 -0.94623282 -0.96263851 0.19087193 1.72932420
[91] -1.49328859 0.70329986 -0.17235284 0.31389489 -0.35702739 -0.81338454
[97] 1.94068097 1.37182285 -0.27643015 0.62755628
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 1.14432727 0.34878492 0.89726325 0.50253217 0.71885328 1.35362342
[7] 0.37192921 -2.62274423 2.05452398 -0.30729981 -0.67767967 -0.20165000
[13] -0.09690588 -0.75609705 -1.48514401 0.06858238 -0.08772810 0.66035543
[19] -0.37875920 2.46274053 -0.78598587 -1.23736982 -0.10267061 0.20214338
[25] -1.31078844 -0.80344970 -0.48864627 -1.19335898 1.42074661 0.59465774
[31] 1.60318891 -1.56559155 0.05625618 1.67627287 -1.17154637 -0.66155941
[37] 1.53383400 0.41417486 -1.54723387 -0.64253509 -0.50824221 -0.90908724
[43] 0.46315352 0.48612520 1.18048025 1.18323396 -0.50999727 0.58519784
[49] -0.59786516 0.23251015 -0.31501298 2.34928546 -0.25838090 -2.32121397
[55] 1.32183757 0.39329152 0.66129162 -1.05249742 0.14112762 0.85106992
[61] 0.66645307 -1.75453081 0.15588281 -0.59964812 -0.34598634 0.58983358
[67] 1.18771127 0.31372010 2.11626823 -1.59835591 0.11191282 -0.23464494
[73] -0.56408395 -0.51513037 -1.00138910 -1.05782936 0.16494219 0.97656307
[79] 0.96333458 0.22234863 -1.03387044 1.84807242 0.87981322 1.00766232
[85] -0.19745948 0.67015023 -0.94623282 -0.96263851 0.19087193 1.72932420
[91] -1.49328859 0.70329986 -0.17235284 0.31389489 -0.35702739 -0.81338454
[97] 1.94068097 1.37182285 -0.27643015 0.62755628
> colMin(tmp)
[1] 1.14432727 0.34878492 0.89726325 0.50253217 0.71885328 1.35362342
[7] 0.37192921 -2.62274423 2.05452398 -0.30729981 -0.67767967 -0.20165000
[13] -0.09690588 -0.75609705 -1.48514401 0.06858238 -0.08772810 0.66035543
[19] -0.37875920 2.46274053 -0.78598587 -1.23736982 -0.10267061 0.20214338
[25] -1.31078844 -0.80344970 -0.48864627 -1.19335898 1.42074661 0.59465774
[31] 1.60318891 -1.56559155 0.05625618 1.67627287 -1.17154637 -0.66155941
[37] 1.53383400 0.41417486 -1.54723387 -0.64253509 -0.50824221 -0.90908724
[43] 0.46315352 0.48612520 1.18048025 1.18323396 -0.50999727 0.58519784
[49] -0.59786516 0.23251015 -0.31501298 2.34928546 -0.25838090 -2.32121397
[55] 1.32183757 0.39329152 0.66129162 -1.05249742 0.14112762 0.85106992
[61] 0.66645307 -1.75453081 0.15588281 -0.59964812 -0.34598634 0.58983358
[67] 1.18771127 0.31372010 2.11626823 -1.59835591 0.11191282 -0.23464494
[73] -0.56408395 -0.51513037 -1.00138910 -1.05782936 0.16494219 0.97656307
[79] 0.96333458 0.22234863 -1.03387044 1.84807242 0.87981322 1.00766232
[85] -0.19745948 0.67015023 -0.94623282 -0.96263851 0.19087193 1.72932420
[91] -1.49328859 0.70329986 -0.17235284 0.31389489 -0.35702739 -0.81338454
[97] 1.94068097 1.37182285 -0.27643015 0.62755628
> colMedians(tmp)
[1] 1.14432727 0.34878492 0.89726325 0.50253217 0.71885328 1.35362342
[7] 0.37192921 -2.62274423 2.05452398 -0.30729981 -0.67767967 -0.20165000
[13] -0.09690588 -0.75609705 -1.48514401 0.06858238 -0.08772810 0.66035543
[19] -0.37875920 2.46274053 -0.78598587 -1.23736982 -0.10267061 0.20214338
[25] -1.31078844 -0.80344970 -0.48864627 -1.19335898 1.42074661 0.59465774
[31] 1.60318891 -1.56559155 0.05625618 1.67627287 -1.17154637 -0.66155941
[37] 1.53383400 0.41417486 -1.54723387 -0.64253509 -0.50824221 -0.90908724
[43] 0.46315352 0.48612520 1.18048025 1.18323396 -0.50999727 0.58519784
[49] -0.59786516 0.23251015 -0.31501298 2.34928546 -0.25838090 -2.32121397
[55] 1.32183757 0.39329152 0.66129162 -1.05249742 0.14112762 0.85106992
[61] 0.66645307 -1.75453081 0.15588281 -0.59964812 -0.34598634 0.58983358
[67] 1.18771127 0.31372010 2.11626823 -1.59835591 0.11191282 -0.23464494
[73] -0.56408395 -0.51513037 -1.00138910 -1.05782936 0.16494219 0.97656307
[79] 0.96333458 0.22234863 -1.03387044 1.84807242 0.87981322 1.00766232
[85] -0.19745948 0.67015023 -0.94623282 -0.96263851 0.19087193 1.72932420
[91] -1.49328859 0.70329986 -0.17235284 0.31389489 -0.35702739 -0.81338454
[97] 1.94068097 1.37182285 -0.27643015 0.62755628
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.144327 0.3487849 0.8972632 0.5025322 0.7188533 1.353623 0.3719292
[2,] 1.144327 0.3487849 0.8972632 0.5025322 0.7188533 1.353623 0.3719292
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -2.622744 2.054524 -0.3072998 -0.6776797 -0.20165 -0.09690588 -0.7560971
[2,] -2.622744 2.054524 -0.3072998 -0.6776797 -0.20165 -0.09690588 -0.7560971
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.485144 0.06858238 -0.0877281 0.6603554 -0.3787592 2.462741 -0.7859859
[2,] -1.485144 0.06858238 -0.0877281 0.6603554 -0.3787592 2.462741 -0.7859859
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.23737 -0.1026706 0.2021434 -1.310788 -0.8034497 -0.4886463 -1.193359
[2,] -1.23737 -0.1026706 0.2021434 -1.310788 -0.8034497 -0.4886463 -1.193359
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.420747 0.5946577 1.603189 -1.565592 0.05625618 1.676273 -1.171546
[2,] 1.420747 0.5946577 1.603189 -1.565592 0.05625618 1.676273 -1.171546
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.6615594 1.533834 0.4141749 -1.547234 -0.6425351 -0.5082422 -0.9090872
[2,] -0.6615594 1.533834 0.4141749 -1.547234 -0.6425351 -0.5082422 -0.9090872
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.4631535 0.4861252 1.18048 1.183234 -0.5099973 0.5851978 -0.5978652
[2,] 0.4631535 0.4861252 1.18048 1.183234 -0.5099973 0.5851978 -0.5978652
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.2325101 -0.315013 2.349285 -0.2583809 -2.321214 1.321838 0.3932915
[2,] 0.2325101 -0.315013 2.349285 -0.2583809 -2.321214 1.321838 0.3932915
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.6612916 -1.052497 0.1411276 0.8510699 0.6664531 -1.754531 0.1558828
[2,] 0.6612916 -1.052497 0.1411276 0.8510699 0.6664531 -1.754531 0.1558828
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.5996481 -0.3459863 0.5898336 1.187711 0.3137201 2.116268 -1.598356
[2,] -0.5996481 -0.3459863 0.5898336 1.187711 0.3137201 2.116268 -1.598356
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.1119128 -0.2346449 -0.564084 -0.5151304 -1.001389 -1.057829 0.1649422
[2,] 0.1119128 -0.2346449 -0.564084 -0.5151304 -1.001389 -1.057829 0.1649422
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.9765631 0.9633346 0.2223486 -1.03387 1.848072 0.8798132 1.007662
[2,] 0.9765631 0.9633346 0.2223486 -1.03387 1.848072 0.8798132 1.007662
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.1974595 0.6701502 -0.9462328 -0.9626385 0.1908719 1.729324 -1.493289
[2,] -0.1974595 0.6701502 -0.9462328 -0.9626385 0.1908719 1.729324 -1.493289
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.7032999 -0.1723528 0.3138949 -0.3570274 -0.8133845 1.940681 1.371823
[2,] 0.7032999 -0.1723528 0.3138949 -0.3570274 -0.8133845 1.940681 1.371823
[,99] [,100]
[1,] -0.2764302 0.6275563
[2,] -0.2764302 0.6275563
>
>
> Max(tmp2)
[1] 2.010971
> Min(tmp2)
[1] -2.348544
> mean(tmp2)
[1] 0.1125422
> Sum(tmp2)
[1] 11.25422
> Var(tmp2)
[1] 0.853229
>
> rowMeans(tmp2)
[1] -0.541427515 0.300517070 -0.992862317 0.532695753 0.970897115
[6] 0.159923197 0.596757148 -1.714493412 1.110204177 -0.891155430
[11] 0.765221776 -0.088799534 1.325518692 -0.001255943 1.149104514
[16] 0.591134008 0.217327357 0.073844777 0.106456357 -0.404372724
[21] 0.307958882 -0.903776044 0.113383065 -1.151942804 -1.001372839
[26] -0.390788044 0.875841783 -0.974262966 1.159605898 -0.936698287
[31] -1.648483529 -0.028039621 -0.582916567 -0.467893225 -0.247766758
[36] -0.780830814 1.098296359 0.712731170 1.637552829 0.747657099
[41] 1.320717061 -0.475653897 -0.006954620 1.108312317 0.720122730
[46] 0.623549100 1.694195870 0.215513913 -1.020863873 0.743995198
[51] 0.185878056 -0.160199298 -0.031246585 0.312049840 0.317132415
[56] 1.540502680 0.423762887 0.332316669 0.502912504 -2.348544468
[61] 1.836726691 -0.545019332 -0.559723551 -0.056647523 1.135132740
[66] 1.645477332 -1.723364261 -0.494782644 0.411519331 0.079043435
[71] -0.580260813 -1.037568562 1.830786337 -0.856997889 -0.390419511
[76] -0.114377327 -0.361671787 0.086679072 0.497321780 -1.242678496
[81] -1.527833084 -0.420354709 -0.077530841 0.092746302 0.230258568
[86] 1.704282761 -1.223843073 1.078816434 0.442339984 0.521738809
[91] -1.145799219 1.309998020 1.311603416 0.096880687 -0.380936935
[96] -0.701248036 2.010970816 0.628420290 -0.559302547 1.502846644
> rowSums(tmp2)
[1] -0.541427515 0.300517070 -0.992862317 0.532695753 0.970897115
[6] 0.159923197 0.596757148 -1.714493412 1.110204177 -0.891155430
[11] 0.765221776 -0.088799534 1.325518692 -0.001255943 1.149104514
[16] 0.591134008 0.217327357 0.073844777 0.106456357 -0.404372724
[21] 0.307958882 -0.903776044 0.113383065 -1.151942804 -1.001372839
[26] -0.390788044 0.875841783 -0.974262966 1.159605898 -0.936698287
[31] -1.648483529 -0.028039621 -0.582916567 -0.467893225 -0.247766758
[36] -0.780830814 1.098296359 0.712731170 1.637552829 0.747657099
[41] 1.320717061 -0.475653897 -0.006954620 1.108312317 0.720122730
[46] 0.623549100 1.694195870 0.215513913 -1.020863873 0.743995198
[51] 0.185878056 -0.160199298 -0.031246585 0.312049840 0.317132415
[56] 1.540502680 0.423762887 0.332316669 0.502912504 -2.348544468
[61] 1.836726691 -0.545019332 -0.559723551 -0.056647523 1.135132740
[66] 1.645477332 -1.723364261 -0.494782644 0.411519331 0.079043435
[71] -0.580260813 -1.037568562 1.830786337 -0.856997889 -0.390419511
[76] -0.114377327 -0.361671787 0.086679072 0.497321780 -1.242678496
[81] -1.527833084 -0.420354709 -0.077530841 0.092746302 0.230258568
[86] 1.704282761 -1.223843073 1.078816434 0.442339984 0.521738809
[91] -1.145799219 1.309998020 1.311603416 0.096880687 -0.380936935
[96] -0.701248036 2.010970816 0.628420290 -0.559302547 1.502846644
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.541427515 0.300517070 -0.992862317 0.532695753 0.970897115
[6] 0.159923197 0.596757148 -1.714493412 1.110204177 -0.891155430
[11] 0.765221776 -0.088799534 1.325518692 -0.001255943 1.149104514
[16] 0.591134008 0.217327357 0.073844777 0.106456357 -0.404372724
[21] 0.307958882 -0.903776044 0.113383065 -1.151942804 -1.001372839
[26] -0.390788044 0.875841783 -0.974262966 1.159605898 -0.936698287
[31] -1.648483529 -0.028039621 -0.582916567 -0.467893225 -0.247766758
[36] -0.780830814 1.098296359 0.712731170 1.637552829 0.747657099
[41] 1.320717061 -0.475653897 -0.006954620 1.108312317 0.720122730
[46] 0.623549100 1.694195870 0.215513913 -1.020863873 0.743995198
[51] 0.185878056 -0.160199298 -0.031246585 0.312049840 0.317132415
[56] 1.540502680 0.423762887 0.332316669 0.502912504 -2.348544468
[61] 1.836726691 -0.545019332 -0.559723551 -0.056647523 1.135132740
[66] 1.645477332 -1.723364261 -0.494782644 0.411519331 0.079043435
[71] -0.580260813 -1.037568562 1.830786337 -0.856997889 -0.390419511
[76] -0.114377327 -0.361671787 0.086679072 0.497321780 -1.242678496
[81] -1.527833084 -0.420354709 -0.077530841 0.092746302 0.230258568
[86] 1.704282761 -1.223843073 1.078816434 0.442339984 0.521738809
[91] -1.145799219 1.309998020 1.311603416 0.096880687 -0.380936935
[96] -0.701248036 2.010970816 0.628420290 -0.559302547 1.502846644
> rowMin(tmp2)
[1] -0.541427515 0.300517070 -0.992862317 0.532695753 0.970897115
[6] 0.159923197 0.596757148 -1.714493412 1.110204177 -0.891155430
[11] 0.765221776 -0.088799534 1.325518692 -0.001255943 1.149104514
[16] 0.591134008 0.217327357 0.073844777 0.106456357 -0.404372724
[21] 0.307958882 -0.903776044 0.113383065 -1.151942804 -1.001372839
[26] -0.390788044 0.875841783 -0.974262966 1.159605898 -0.936698287
[31] -1.648483529 -0.028039621 -0.582916567 -0.467893225 -0.247766758
[36] -0.780830814 1.098296359 0.712731170 1.637552829 0.747657099
[41] 1.320717061 -0.475653897 -0.006954620 1.108312317 0.720122730
[46] 0.623549100 1.694195870 0.215513913 -1.020863873 0.743995198
[51] 0.185878056 -0.160199298 -0.031246585 0.312049840 0.317132415
[56] 1.540502680 0.423762887 0.332316669 0.502912504 -2.348544468
[61] 1.836726691 -0.545019332 -0.559723551 -0.056647523 1.135132740
[66] 1.645477332 -1.723364261 -0.494782644 0.411519331 0.079043435
[71] -0.580260813 -1.037568562 1.830786337 -0.856997889 -0.390419511
[76] -0.114377327 -0.361671787 0.086679072 0.497321780 -1.242678496
[81] -1.527833084 -0.420354709 -0.077530841 0.092746302 0.230258568
[86] 1.704282761 -1.223843073 1.078816434 0.442339984 0.521738809
[91] -1.145799219 1.309998020 1.311603416 0.096880687 -0.380936935
[96] -0.701248036 2.010970816 0.628420290 -0.559302547 1.502846644
>
> colMeans(tmp2)
[1] 0.1125422
> colSums(tmp2)
[1] 11.25422
> colVars(tmp2)
[1] 0.853229
> colSd(tmp2)
[1] 0.923704
> colMax(tmp2)
[1] 2.010971
> colMin(tmp2)
[1] -2.348544
> colMedians(tmp2)
[1] 0.1016685
> colRanges(tmp2)
[,1]
[1,] -2.348544
[2,] 2.010971
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.8675962 0.7345759 1.1347022 -1.8260461 -0.8731135 4.1227063
[7] 0.8118737 4.5859800 1.5974067 -2.4563429
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7802956
[2,] -0.3535801
[3,] 0.1318763
[4,] 0.3135550
[5,] 1.4167333
>
> rowApply(tmp,sum)
[1] 5.33234082 -2.30869201 -6.07425627 1.23603784 0.27921635 -0.03931407
[7] 1.30781693 2.50308749 4.43872794 2.02437351
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 3 10 6 7 10 4 9 3 2
[2,] 9 2 6 4 3 3 7 3 5 10
[3,] 8 5 8 9 2 6 3 7 4 1
[4,] 10 1 2 7 4 1 2 5 9 8
[5,] 6 6 3 5 1 8 9 2 1 6
[6,] 7 10 9 8 6 2 8 4 8 5
[7,] 3 7 1 3 8 5 10 1 6 9
[8,] 4 4 5 10 9 4 6 10 7 4
[9,] 5 8 7 1 10 7 5 8 2 7
[10,] 1 9 4 2 5 9 1 6 10 3
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.32721250 -0.72575172 -0.38432323 1.95258104 2.36452809 -0.91891351
[7] 0.40659205 1.45680789 -5.68805887 -0.47064873 -2.81513852 -3.01581168
[13] 3.85798133 0.08947723 -1.92225013 -3.11634388 3.62660881 2.33476902
[19] -0.22185502 2.31581399
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8793215
[2,] -0.7222405
[3,] -0.1814819
[4,] 0.3820739
[5,] 1.0737575
>
> rowApply(tmp,sum)
[1] 0.7975835 -0.7733387 -1.3242849 0.5768396 -0.4779479
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 18 3 10
[2,] 5 7 6 18 13
[3,] 4 14 9 16 9
[4,] 9 5 19 19 12
[5,] 19 18 17 1 15
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.7222405 -0.7836481 -0.8206367 -0.4552018 1.5016889 0.8436150
[2,] 0.3820739 -0.4286707 0.3165743 -0.7015593 1.0082226 0.2068261
[3,] 1.0737575 -0.9166270 -0.3480115 1.3774707 1.0277170 -0.9518792
[4,] -0.8793215 0.9478267 0.6841821 1.5820196 -1.9451862 -0.3921396
[5,] -0.1814819 0.4553674 -0.2164314 0.1498519 0.7720859 -0.6253358
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.9401866 -0.46336106 -0.9388644 1.0349048 -0.2041188 -0.9039562
[2,] 1.4798316 0.25719975 -2.3362040 -1.0956509 -0.6461921 0.1968558
[3,] -0.9572442 2.54429804 -0.4664135 0.6973518 0.4728366 -1.4930459
[4,] -0.1469789 -0.07775677 -0.5650091 0.2548469 -0.4859518 0.6437836
[5,] 0.9711701 -0.80357207 -1.3815679 -1.3621013 -1.9517125 -1.4594490
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.4844457 -0.4824453 0.07915579 0.3597702 0.64084237 1.76610802
[2,] 1.5878016 0.2775131 -1.85723250 -0.7868376 0.09595344 0.21146564
[3,] 0.2737997 -0.4700553 -2.07868578 -1.1926890 -0.23768536 0.49685425
[4,] 0.2384768 -0.7449520 0.81346936 -0.8835658 1.62930519 -0.23769593
[5,] 1.2734575 1.5094168 1.12104299 -0.6130218 1.49819317 0.09803704
[,19] [,20]
[1,] 0.006987734 0.7947246
[2,] 0.320984173 0.7377063
[3,] 0.073229951 -0.2492636
[4,] -0.178897909 0.3203849
[5,] -0.444158969 0.7122618
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.094198 0.3936549 -1.400295 1.601718 -1.184782 -1.3842 2.131556
col8 col9 col10 col11 col12 col13 col14
row1 0.06956195 0.613288 0.1065507 0.6569488 -0.7314381 -0.7180501 -0.12942
col15 col16 col17 col18 col19 col20
row1 -1.05364 0.08371585 -0.3378539 -0.3141042 0.9503847 0.8199274
> tmp[,"col10"]
col10
row1 0.1065507
row2 1.2268885
row3 0.1397412
row4 -1.0273678
row5 1.2335290
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.0941978 0.3936549 -1.4002950 1.6017178 -1.184782 -1.384200 2.131556
row5 0.7252658 -0.5486059 0.1493098 -0.4877456 -1.499751 2.582415 -1.200875
col8 col9 col10 col11 col12 col13 col14
row1 0.06956195 0.613287955 0.1065507 0.6569488 -0.7314381 -0.7180501 -0.129420
row5 1.39723738 0.008932581 1.2335290 0.5555727 -1.3568456 -0.6865885 -1.350235
col15 col16 col17 col18 col19 col20
row1 -1.0536396 0.08371585 -0.3378539 -0.3141042 0.9503847 0.8199274
row5 -0.3427094 0.34518678 0.3498005 -0.4728022 0.9251424 2.1425145
> tmp[,c("col6","col20")]
col6 col20
row1 -1.38419991 0.8199274
row2 -0.73559521 0.6550905
row3 0.78664983 -1.0091229
row4 0.08858293 1.4817649
row5 2.58241545 2.1425145
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.384200 0.8199274
row5 2.582415 2.1425145
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.11191 49.35091 50.77487 49.96538 48.97711 103.7525 48.56725 52.42417
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.76466 50.00556 50.99054 48.99009 50.20638 49.64572 50.58612 47.58616
col17 col18 col19 col20
row1 50.72916 51.43693 50.89487 104.5308
> tmp[,"col10"]
col10
row1 50.00556
row2 31.80036
row3 31.23237
row4 30.66363
row5 52.01837
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.11191 49.35091 50.77487 49.96538 48.97711 103.7525 48.56725 52.42417
row5 53.62602 49.47423 49.12860 48.37023 50.70329 104.7088 51.31696 49.71149
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.76466 50.00556 50.99054 48.99009 50.20638 49.64572 50.58612 47.58616
row5 51.05962 52.01837 47.99027 49.64818 49.87280 50.79019 50.97275 49.45359
col17 col18 col19 col20
row1 50.72916 51.43693 50.89487 104.5308
row5 49.77020 49.38128 49.28676 104.1819
> tmp[,c("col6","col20")]
col6 col20
row1 103.75254 104.53082
row2 75.27091 75.85314
row3 74.13071 73.94448
row4 75.56992 75.04489
row5 104.70885 104.18189
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.7525 104.5308
row5 104.7088 104.1819
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.7525 104.5308
row5 104.7088 104.1819
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.5697213
[2,] 0.6118363
[3,] -0.1297182
[4,] -1.3570687
[5,] 0.1639932
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.1330013 0.45817088
[2,] -0.3527937 0.55832844
[3,] 0.1605607 -0.07986703
[4,] 0.4524359 1.77428787
[5,] 1.3403419 -0.66373318
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.619321 -0.5542855
[2,] 1.439210 1.0387691
[3,] -1.392680 0.3877346
[4,] -1.279090 -2.3058442
[5,] 1.296397 -2.0308885
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.619321
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.619321
[2,] 1.439210
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -0.3850039 -0.5296737 0.3065954 2.0508985 -1.216908 0.0423059 0.01503923
row1 -0.8778999 0.3748025 -0.4042066 -0.9677072 1.026538 1.0171517 2.81725534
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.2402373 -0.2037456 0.7989983 -1.1594875 1.7794378 0.7109148 0.1310685
row1 1.7020089 1.2607250 -0.4616040 -0.4378341 -0.6787552 0.1950520 0.9445818
[,15] [,16] [,17] [,18] [,19] [,20]
row3 1.7574105 -0.1814392 0.7183430 0.6769143 1.1167790 -0.8316093
row1 -0.8717135 -0.9900885 -0.4487782 0.5869337 -0.6353128 0.6378698
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.1255013 -0.1163352 0.5107408 0.5732563 1.216881 1.290352 0.3124354
[,8] [,9] [,10]
row2 -0.3488736 -0.04356957 -0.5605538
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row5 -0.7644367 0.1133074 -0.144855 -0.009863197 -0.6039131 -1.336447
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row5 -0.6641686 1.80628 -0.3248707 -1.032782 -0.3440908 0.6823075 -1.663724
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.9134713 1.61991 -1.789251 -1.388892 -0.5494003 0.2152475 0.06897645
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
> dimnames(tmp) <- NULL
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
NULL
>
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
>
> ###
> ### Testing logical indexing
> ###
> ###
>
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]
>
> for (rep in 1:10){
+ which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+ which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+
+ if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+ stop("No agreement when logical indexing\n")
+ }
+
+ if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+ }
+ if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+ }
+
+
+ if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+ }
+ }
>
>
> ##
> ## Test the ReadOnlyMode
> ##
>
> ReadOnlyMode(tmp)
<pointer: 0x600003728060>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f592ac22d0b"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f59321b431b"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f591bd2bb50"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5928078f75"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5985b5edb"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5926b08026"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f59dad52a2"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f596e0c10b1"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f595a1c0ce8"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f596793818f"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5951f0869"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f593861281f"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5972912823"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f5917e24c98"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5f59a129b68"
>
>
> ### testing coercion functions
> ###
>
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
>
>
>
> ### testing whether can move storage from one location to another
>
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x60000370c120>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000370c120>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x60000370c120>
> rowMedians(tmp)
[1] 0.0703917920 0.5166651288 -0.0752981967 -0.2497437351 -0.7811524348
[6] -0.0088641258 -0.6140314275 0.3379935713 -0.3439220113 -0.1331270721
[11] 0.0878555335 0.2666979146 -0.1415009134 -0.0738535217 0.4091150174
[16] 0.5945516060 -0.0206799438 0.2823062497 -0.4139126338 -0.2173808603
[21] -0.4087119293 -0.2550002369 -0.4575977249 0.0655375444 -0.1547457409
[26] 0.3341284459 0.1591487936 0.4389775705 0.3687913169 0.2046367877
[31] 0.1694577697 0.7068466950 0.0256812972 -0.5098958000 0.1865530190
[36] -0.1039463057 0.2858625677 0.0734308776 -0.0594295369 0.3073615467
[41] -0.3548185068 0.6441996919 0.5352383305 -0.2322761633 -0.5022077622
[46] -0.1496488039 0.0164129251 -0.2356100370 0.0642991451 -0.7633478926
[51] 0.0611371798 0.3064999908 0.1972296694 -0.0775453580 0.0958562931
[56] 0.0147602360 0.1545368728 -0.0420440902 -0.0883647092 -0.2861323140
[61] 0.1097296183 0.3183583371 0.6225196533 -0.1448650635 -0.0289921455
[66] -0.2808215009 0.1463526623 -0.4514648752 0.2404226504 -0.0280017933
[71] 0.3150885664 -0.3297219626 0.2863674948 -0.1201048559 0.2270231611
[76] -0.8361634867 -0.1873876437 -0.2443850389 0.5055383015 0.0732547346
[81] 0.1053196504 0.2464545653 -0.5011297337 -0.0131690470 0.7174163654
[86] 0.2748978765 -0.0476747077 0.2761812263 -0.2263911746 -0.0937095880
[91] -0.1895784806 -0.5131974633 -0.2854226892 -0.5737294625 0.2557410497
[96] -0.3513037566 0.2656113478 -0.7230179189 -0.2846404793 0.3839287373
[101] 0.3417959972 0.5351545967 0.1134723155 0.0384767030 0.3654724893
[106] -0.4808341205 0.2112379138 0.6808005639 0.0610589840 0.3192885991
[111] -0.0563531816 0.0002187353 0.5725598214 0.4369101842 0.8193202781
[116] -0.3142793635 -0.2797105597 0.0769894537 0.3000391405 -0.1883266648
[121] -0.1263972784 0.5673261533 -0.0144867738 -0.1015965049 -0.1045215202
[126] 0.0040241542 0.1498025280 0.4485952289 0.4418854966 0.1775399353
[131] 0.1275541138 0.4040729609 0.0517446388 0.5083413334 0.3612390691
[136] -0.0482198908 0.0040598915 0.0369134872 0.0362586487 -0.2082127656
[141] 0.1366789872 -0.2845201249 -0.5315011595 -0.3028753930 0.2002994723
[146] 0.1320746003 0.3257367928 0.2148834074 -0.5357033885 -0.4182517759
[151] 0.0938930942 -0.6622331627 0.4697099002 0.0309838866 0.2467842584
[156] 0.2280914494 0.1355136054 0.0698939395 -0.0545284954 -0.1287819093
[161] -0.0260607470 -0.4196330612 0.2976568109 0.5673897263 -0.6069386014
[166] 0.3773502264 0.0349137893 -0.2793876286 0.1050235667 -0.4530800457
[171] -0.5781215543 0.1977942838 0.1960364407 0.3331027681 0.7044866098
[176] -0.1887169107 0.0236313012 -0.3103417145 0.1444155096 -0.0135271667
[181] 0.2655746917 0.1654423159 -0.0587698676 -0.4332322256 -0.0324668589
[186] -0.6418540916 0.2134413150 -0.2579018370 -0.0511810535 -0.0484647964
[191] 0.1784124244 -0.4779879648 0.3541102463 0.0068810177 0.4621490325
[196] -0.4400294498 0.0385821433 -0.0802672484 -0.3125817491 0.0304512063
[201] 0.0191719345 -0.6581702142 0.0925540153 0.1304708898 0.0057175298
[206] -0.3708105447 -0.3725947569 -0.1996267990 0.2757376493 -0.4738477656
[211] -0.8080325764 0.0163200560 -0.0591378570 -0.1259947345 -0.3729049287
[216] 0.2023297289 0.0972783633 0.0051002580 0.0857176429 -0.3370401404
[221] 0.0023026660 0.5484155294 -0.1666210661 0.1329528071 0.1494657143
[226] 0.2056790635 0.0343144213 -0.2410592609 -0.4697612338 -0.0674251573
>
> proc.time()
user system elapsed
2.656 14.556 17.675
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002b88300>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002b88300>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002b88300>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000
<pointer: 0x600002b88300>
> rm(P)
>
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1
Printing Values
<pointer: 0x600002bcc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002bcc000>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000
0.000000
0.000000
0.000000
0.000000
<pointer: 0x600002bcc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002bcc000>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x600002bcc000>
> rm(P)
>
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002bcc180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002bcc180>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x600002bcc180>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002bcc180>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x600002bcc180>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002bcc180>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x600002bcc180>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002bcc180>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x600002bcc180>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ba00c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002ba00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ba00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ba00c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile640e1b207ce0" "BufferedMatrixFile640e71e66409"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile640e1b207ce0" "BufferedMatrixFile640e71e66409"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002b9c000>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ba03c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ba03c0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002ba03c0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002ba03c0>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002ba05a0>
> .Call("R_bm_getValue",P,3,3)
[1] 6
>
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 12345.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600002ba05a0>
> rm(P)
>
> proc.time()
user system elapsed
0.331 0.152 0.495
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.322 0.097 0.460