| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-01 13:06 -0400 (Wed, 01 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.6.0 alpha (2026-03-30 r89742) | 4816 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-03-28 r89739) | 4539 |
| 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 258/2374 | 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 | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
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: 2026-03-31 18:24:19 -0400 (Tue, 31 Mar 2026) |
| EndedAt: 2026-03-31 18:24:40 -0400 (Tue, 31 Mar 2026) |
| EllapsedTime: 20.2 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 version 4.6.0 alpha (2026-03-28 r89739)
* using platform: aarch64-apple-darwin23
* R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-03-31 22:24:20 UTC
* 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 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.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/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/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]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu23 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/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/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 version 4.6.0 alpha (2026-03-28 r89739)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.125 0.051 0.177
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 alpha (2026-03-28 r89739)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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 484129 25.9 1067215 57 NA 632020 33.8
Vcells 896942 6.9 8388608 64 196608 2112095 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] "Tue Mar 31 18:24:30 2026"
> 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] "Tue Mar 31 18:24:30 2026"
>
>
> 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: 0x1019f0430>
>
>
>
> 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] "Tue Mar 31 18:24:31 2026"
> 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] "Tue Mar 31 18:24:32 2026"
>
> ColMode(tmp2)
<pointer: 0x1019f0430>
>
>
>
> ### 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.2079428 0.76693709 -0.5430823 0.4007644
[2,] 0.1384246 -1.39472465 -2.7138824 -1.4118826
[3,] -1.0887189 -0.73697903 -0.1491385 -0.1049277
[4,] -0.2462631 0.08388954 -1.0555934 -1.0746648
> 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.2079428 0.76693709 0.5430823 0.4007644
[2,] 0.1384246 1.39472465 2.7138824 1.4118826
[3,] 1.0887189 0.73697903 0.1491385 0.1049277
[4,] 0.2462631 0.08388954 1.0555934 1.0746648
> 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.0103917 0.8757494 0.7369412 0.6330595
[2,] 0.3720546 1.1809846 1.6473865 1.1882267
[3,] 1.0434169 0.8584748 0.3861845 0.3239255
[4,] 0.4962491 0.2896369 1.0274207 1.0366604
>
> 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.31186 34.52443 32.91249 31.73136
[2,] 28.85897 38.20457 44.18775 38.29415
[3,] 36.52289 34.32173 29.01098 28.34418
[4,] 30.20875 27.98026 36.32980 36.44127
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x101a06fa0>
> exp(tmp5)
<pointer: 0x101a06fa0>
> log(tmp5,2)
<pointer: 0x101a06fa0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.9571
> Min(tmp5)
[1] 53.57873
> mean(tmp5)
[1] 72.43913
> Sum(tmp5)
[1] 14487.83
> Var(tmp5)
[1] 875.659
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.15036 74.51905 68.02047 72.65077 72.26782 70.54381 69.35074 68.54031
[9] 70.11136 69.23663
> rowSums(tmp5)
[1] 1783.007 1490.381 1360.409 1453.015 1445.356 1410.876 1387.015 1370.806
[9] 1402.227 1384.733
> rowVars(tmp5)
[1] 8066.74423 94.47722 65.18959 111.03787 32.16498 72.77002
[7] 77.22859 69.95536 104.54625 111.79272
> rowSd(tmp5)
[1] 89.815056 9.719939 8.074007 10.537451 5.671418 8.530534 8.787980
[8] 8.363932 10.224786 10.573208
> rowMax(tmp5)
[1] 468.95712 91.97101 82.39773 90.39508 85.39147 82.91992 89.61035
[8] 89.24520 92.92358 88.82033
> rowMin(tmp5)
[1] 53.66811 58.72915 56.71497 56.27534 62.97026 53.82715 58.08884 57.07149
[9] 57.42336 53.57873
>
> colMeans(tmp5)
[1] 110.12343 69.38908 72.26778 72.24156 69.64847 73.47140 68.94980
[8] 67.77677 73.13789 72.80716 71.11379 64.65351 69.65095 70.21072
[15] 68.59602 66.67068 71.24336 72.90327 70.94704 72.97997
> colSums(tmp5)
[1] 1101.2343 693.8908 722.6778 722.4156 696.4847 734.7140 689.4980
[8] 677.7677 731.3789 728.0716 711.1379 646.5351 696.5095 702.1072
[15] 685.9602 666.7068 712.4336 729.0327 709.4704 729.7997
> colVars(tmp5)
[1] 15965.25591 43.78734 110.80309 71.74740 96.22937 79.97705
[7] 40.37718 43.49723 97.42632 78.13334 103.46424 47.04087
[13] 47.46420 98.61498 103.83224 116.66199 99.40555 113.36260
[19] 116.12518 110.60010
> colSd(tmp5)
[1] 126.353694 6.617200 10.526305 8.470384 9.809657 8.942989
[7] 6.354304 6.595243 9.870477 8.839307 10.171737 6.858634
[13] 6.889426 9.930508 10.189810 10.801018 9.970233 10.647188
[19] 10.776139 10.516658
> colMax(tmp5)
[1] 468.95712 79.51781 91.97101 81.62866 89.24520 88.50806 76.73153
[8] 82.13594 87.90251 82.89309 90.33728 73.76590 84.60930 82.82568
[15] 85.39147 88.82033 87.06030 90.39508 92.92358 89.09193
> colMin(tmp5)
[1] 60.06617 58.23724 53.82715 58.99470 58.42429 63.06309 57.42336 60.00447
[9] 59.01829 56.71497 57.07149 53.57873 62.64743 54.76857 58.55258 53.66811
[17] 58.31283 57.57636 58.79743 58.82585
>
>
> ### 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] 89.15036 74.51905 68.02047 72.65077 72.26782 70.54381 NA 68.54031
[9] 70.11136 69.23663
> rowSums(tmp5)
[1] 1783.007 1490.381 1360.409 1453.015 1445.356 1410.876 NA 1370.806
[9] 1402.227 1384.733
> rowVars(tmp5)
[1] 8066.74423 94.47722 65.18959 111.03787 32.16498 72.77002
[7] 79.82852 69.95536 104.54625 111.79272
> rowSd(tmp5)
[1] 89.815056 9.719939 8.074007 10.537451 5.671418 8.530534 8.934681
[8] 8.363932 10.224786 10.573208
> rowMax(tmp5)
[1] 468.95712 91.97101 82.39773 90.39508 85.39147 82.91992 NA
[8] 89.24520 92.92358 88.82033
> rowMin(tmp5)
[1] 53.66811 58.72915 56.71497 56.27534 62.97026 53.82715 NA 57.07149
[9] 57.42336 53.57873
>
> colMeans(tmp5)
[1] 110.12343 69.38908 72.26778 72.24156 69.64847 73.47140 68.94980
[8] 67.77677 73.13789 72.80716 71.11379 64.65351 69.65095 70.21072
[15] 68.59602 66.67068 NA 72.90327 70.94704 72.97997
> colSums(tmp5)
[1] 1101.2343 693.8908 722.6778 722.4156 696.4847 734.7140 689.4980
[8] 677.7677 731.3789 728.0716 711.1379 646.5351 696.5095 702.1072
[15] 685.9602 666.7068 NA 729.0327 709.4704 729.7997
> colVars(tmp5)
[1] 15965.25591 43.78734 110.80309 71.74740 96.22937 79.97705
[7] 40.37718 43.49723 97.42632 78.13334 103.46424 47.04087
[13] 47.46420 98.61498 103.83224 116.66199 NA 113.36260
[19] 116.12518 110.60010
> colSd(tmp5)
[1] 126.353694 6.617200 10.526305 8.470384 9.809657 8.942989
[7] 6.354304 6.595243 9.870477 8.839307 10.171737 6.858634
[13] 6.889426 9.930508 10.189810 10.801018 NA 10.647188
[19] 10.776139 10.516658
> colMax(tmp5)
[1] 468.95712 79.51781 91.97101 81.62866 89.24520 88.50806 76.73153
[8] 82.13594 87.90251 82.89309 90.33728 73.76590 84.60930 82.82568
[15] 85.39147 88.82033 NA 90.39508 92.92358 89.09193
> colMin(tmp5)
[1] 60.06617 58.23724 53.82715 58.99470 58.42429 63.06309 57.42336 60.00447
[9] 59.01829 56.71497 57.07149 53.57873 62.64743 54.76857 58.55258 53.66811
[17] NA 57.57636 58.79743 58.82585
>
> Max(tmp5,na.rm=TRUE)
[1] 468.9571
> Min(tmp5,na.rm=TRUE)
[1] 53.57873
> mean(tmp5,na.rm=TRUE)
[1] 72.48167
> Sum(tmp5,na.rm=TRUE)
[1] 14423.85
> Var(tmp5,na.rm=TRUE)
[1] 879.7178
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.15036 74.51905 68.02047 72.65077 72.26782 70.54381 69.63372 68.54031
[9] 70.11136 69.23663
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.007 1490.381 1360.409 1453.015 1445.356 1410.876 1323.041 1370.806
[9] 1402.227 1384.733
> rowVars(tmp5,na.rm=TRUE)
[1] 8066.74423 94.47722 65.18959 111.03787 32.16498 72.77002
[7] 79.82852 69.95536 104.54625 111.79272
> rowSd(tmp5,na.rm=TRUE)
[1] 89.815056 9.719939 8.074007 10.537451 5.671418 8.530534 8.934681
[8] 8.363932 10.224786 10.573208
> rowMax(tmp5,na.rm=TRUE)
[1] 468.95712 91.97101 82.39773 90.39508 85.39147 82.91992 89.61035
[8] 89.24520 92.92358 88.82033
> rowMin(tmp5,na.rm=TRUE)
[1] 53.66811 58.72915 56.71497 56.27534 62.97026 53.82715 58.08884 57.07149
[9] 57.42336 53.57873
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.12343 69.38908 72.26778 72.24156 69.64847 73.47140 68.94980
[8] 67.77677 73.13789 72.80716 71.11379 64.65351 69.65095 70.21072
[15] 68.59602 66.67068 72.05106 72.90327 70.94704 72.97997
> colSums(tmp5,na.rm=TRUE)
[1] 1101.2343 693.8908 722.6778 722.4156 696.4847 734.7140 689.4980
[8] 677.7677 731.3789 728.0716 711.1379 646.5351 696.5095 702.1072
[15] 685.9602 666.7068 648.4595 729.0327 709.4704 729.7997
> colVars(tmp5,na.rm=TRUE)
[1] 15965.25591 43.78734 110.80309 71.74740 96.22937 79.97705
[7] 40.37718 43.49723 97.42632 78.13334 103.46424 47.04087
[13] 47.46420 98.61498 103.83224 116.66199 104.49204 113.36260
[19] 116.12518 110.60010
> colSd(tmp5,na.rm=TRUE)
[1] 126.353694 6.617200 10.526305 8.470384 9.809657 8.942989
[7] 6.354304 6.595243 9.870477 8.839307 10.171737 6.858634
[13] 6.889426 9.930508 10.189810 10.801018 10.222135 10.647188
[19] 10.776139 10.516658
> colMax(tmp5,na.rm=TRUE)
[1] 468.95712 79.51781 91.97101 81.62866 89.24520 88.50806 76.73153
[8] 82.13594 87.90251 82.89309 90.33728 73.76590 84.60930 82.82568
[15] 85.39147 88.82033 87.06030 90.39508 92.92358 89.09193
> colMin(tmp5,na.rm=TRUE)
[1] 60.06617 58.23724 53.82715 58.99470 58.42429 63.06309 57.42336 60.00447
[9] 59.01829 56.71497 57.07149 53.57873 62.64743 54.76857 58.55258 53.66811
[17] 58.31283 57.57636 58.79743 58.82585
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.15036 74.51905 68.02047 72.65077 72.26782 70.54381 NaN 68.54031
[9] 70.11136 69.23663
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.007 1490.381 1360.409 1453.015 1445.356 1410.876 0.000 1370.806
[9] 1402.227 1384.733
> rowVars(tmp5,na.rm=TRUE)
[1] 8066.74423 94.47722 65.18959 111.03787 32.16498 72.77002
[7] NA 69.95536 104.54625 111.79272
> rowSd(tmp5,na.rm=TRUE)
[1] 89.815056 9.719939 8.074007 10.537451 5.671418 8.530534 NA
[8] 8.363932 10.224786 10.573208
> rowMax(tmp5,na.rm=TRUE)
[1] 468.95712 91.97101 82.39773 90.39508 85.39147 82.91992 NA
[8] 89.24520 92.92358 88.82033
> rowMin(tmp5,na.rm=TRUE)
[1] 53.66811 58.72915 56.71497 56.27534 62.97026 53.82715 NA 57.07149
[9] 57.42336 53.57873
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.40266 69.98356 72.11331 72.85270 70.32209 71.80066 68.40725
[8] 67.85924 72.29539 73.52676 70.37437 65.38292 70.42912 70.83656
[15] 69.05682 66.55020 NaN 73.47380 71.37465 74.55265
> colSums(tmp5,na.rm=TRUE)
[1] 1011.6240 629.8520 649.0198 655.6743 632.8988 646.2059 615.6653
[8] 610.7332 650.6585 661.7408 633.3693 588.4462 633.8620 637.5290
[15] 621.5113 598.9518 0.0000 661.2642 642.3718 670.9739
> colVars(tmp5,na.rm=TRUE)
[1] 17902.47035 45.28499 124.38503 76.51406 103.15327 58.57123
[7] 42.11286 48.85786 101.61928 82.07455 110.24643 46.93557
[13] 46.58482 106.53548 114.42250 131.08144 NA 123.87103
[19] 128.58382 96.60022
> colSd(tmp5,na.rm=TRUE)
[1] 133.800113 6.729412 11.152804 8.747231 10.156440 7.653184
[7] 6.489442 6.989840 10.080639 9.059501 10.499830 6.850954
[13] 6.825307 10.321603 10.696845 11.449080 NA 11.129736
[19] 11.339480 9.828541
> colMax(tmp5,na.rm=TRUE)
[1] 468.95712 79.51781 91.97101 81.62866 89.24520 81.09172 76.73153
[8] 82.13594 87.90251 82.89309 90.33728 73.76590 84.60930 82.82568
[15] 85.39147 88.82033 -Inf 90.39508 92.92358 89.09193
> colMin(tmp5,na.rm=TRUE)
[1] 60.06617 58.23724 53.82715 58.99470 58.42429 63.06309 57.42336 60.00447
[9] 59.01829 56.71497 57.07149 53.57873 63.45511 54.76857 58.55258 53.66811
[17] Inf 57.57636 58.79743 59.79415
>
>
>
>
> 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] 106.4907 228.4392 223.6916 352.6604 239.7366 235.5076 210.7880 161.6450
[9] 263.8384 236.8286
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 106.4907 228.4392 223.6916 352.6604 239.7366 235.5076 210.7880 161.6450
[9] 263.8384 236.8286
>
>
>
> 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] 1.989520e-13 -2.842171e-14 1.705303e-13 2.842171e-14 -1.421085e-13
[6] 1.136868e-13 1.136868e-13 0.000000e+00 5.684342e-14 8.526513e-14
[11] -1.705303e-13 -2.842171e-14 3.410605e-13 -2.842171e-13 5.684342e-14
[16] -4.263256e-14 3.410605e-13 8.526513e-14 2.842171e-14 1.989520e-13
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
10 2
5 6
3 18
1 6
3 10
8 13
9 7
3 7
1 6
6 12
2 19
9 7
1 12
10 15
2 19
1 16
10 4
4 20
8 1
6 2
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.11621
> Min(tmp)
[1] -4.139374
> mean(tmp)
[1] -0.05003477
> Sum(tmp)
[1] -5.003477
> Var(tmp)
[1] 0.9465146
>
> rowMeans(tmp)
[1] -0.05003477
> rowSums(tmp)
[1] -5.003477
> rowVars(tmp)
[1] 0.9465146
> rowSd(tmp)
[1] 0.9728898
> rowMax(tmp)
[1] 2.11621
> rowMin(tmp)
[1] -4.139374
>
> colMeans(tmp)
[1] 0.261771604 -0.195912628 0.127671137 0.490793517 -1.159297308
[6] 0.007082273 0.479951800 -1.084054639 0.867341767 0.414616853
[11] 1.783641966 -0.450676571 0.303818511 -2.905148714 0.581246351
[16] 0.308857359 0.363325587 -1.143355285 0.273918049 0.550279470
[21] -0.765253125 1.029148206 -0.249828823 0.312048269 -0.136475775
[26] 0.064795861 -1.237376590 -0.169155995 -1.154014468 -0.470254965
[31] 1.344875449 -1.430773180 -1.140835996 0.453367593 1.026932561
[36] 0.058506239 -1.280816602 1.136934007 0.028916639 -0.880759354
[41] 0.020818475 0.606602654 -0.376582140 0.248842911 -0.013230275
[46] 1.407398084 -0.015730214 -0.587349147 -0.778187527 -4.139373667
[51] -0.125437608 -0.116698599 -1.321107742 2.084639147 -0.198984838
[56] -0.392122172 -0.025262781 1.471285479 -1.122096230 -0.262402347
[61] 0.125810187 0.437280146 -0.879693107 -2.309380665 -0.476908797
[66] -0.643783660 -0.324635079 0.249150616 0.480644121 0.247372519
[71] -0.493326028 1.052951315 0.590481166 -0.038094460 -0.131453634
[76] 0.885293328 0.001292077 -0.975936423 -0.037557685 -0.220548524
[81] 0.512119223 -0.384559405 0.708506300 -0.833076985 0.877426556
[86] 0.897727331 -0.854452674 0.755895467 -2.078587666 0.892210169
[91] -0.092216454 1.601237432 0.342389950 0.938774147 -0.725845750
[96] 0.507795086 -0.567775403 -0.495219947 2.116209705 0.558135945
> colSums(tmp)
[1] 0.261771604 -0.195912628 0.127671137 0.490793517 -1.159297308
[6] 0.007082273 0.479951800 -1.084054639 0.867341767 0.414616853
[11] 1.783641966 -0.450676571 0.303818511 -2.905148714 0.581246351
[16] 0.308857359 0.363325587 -1.143355285 0.273918049 0.550279470
[21] -0.765253125 1.029148206 -0.249828823 0.312048269 -0.136475775
[26] 0.064795861 -1.237376590 -0.169155995 -1.154014468 -0.470254965
[31] 1.344875449 -1.430773180 -1.140835996 0.453367593 1.026932561
[36] 0.058506239 -1.280816602 1.136934007 0.028916639 -0.880759354
[41] 0.020818475 0.606602654 -0.376582140 0.248842911 -0.013230275
[46] 1.407398084 -0.015730214 -0.587349147 -0.778187527 -4.139373667
[51] -0.125437608 -0.116698599 -1.321107742 2.084639147 -0.198984838
[56] -0.392122172 -0.025262781 1.471285479 -1.122096230 -0.262402347
[61] 0.125810187 0.437280146 -0.879693107 -2.309380665 -0.476908797
[66] -0.643783660 -0.324635079 0.249150616 0.480644121 0.247372519
[71] -0.493326028 1.052951315 0.590481166 -0.038094460 -0.131453634
[76] 0.885293328 0.001292077 -0.975936423 -0.037557685 -0.220548524
[81] 0.512119223 -0.384559405 0.708506300 -0.833076985 0.877426556
[86] 0.897727331 -0.854452674 0.755895467 -2.078587666 0.892210169
[91] -0.092216454 1.601237432 0.342389950 0.938774147 -0.725845750
[96] 0.507795086 -0.567775403 -0.495219947 2.116209705 0.558135945
> 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] 0.261771604 -0.195912628 0.127671137 0.490793517 -1.159297308
[6] 0.007082273 0.479951800 -1.084054639 0.867341767 0.414616853
[11] 1.783641966 -0.450676571 0.303818511 -2.905148714 0.581246351
[16] 0.308857359 0.363325587 -1.143355285 0.273918049 0.550279470
[21] -0.765253125 1.029148206 -0.249828823 0.312048269 -0.136475775
[26] 0.064795861 -1.237376590 -0.169155995 -1.154014468 -0.470254965
[31] 1.344875449 -1.430773180 -1.140835996 0.453367593 1.026932561
[36] 0.058506239 -1.280816602 1.136934007 0.028916639 -0.880759354
[41] 0.020818475 0.606602654 -0.376582140 0.248842911 -0.013230275
[46] 1.407398084 -0.015730214 -0.587349147 -0.778187527 -4.139373667
[51] -0.125437608 -0.116698599 -1.321107742 2.084639147 -0.198984838
[56] -0.392122172 -0.025262781 1.471285479 -1.122096230 -0.262402347
[61] 0.125810187 0.437280146 -0.879693107 -2.309380665 -0.476908797
[66] -0.643783660 -0.324635079 0.249150616 0.480644121 0.247372519
[71] -0.493326028 1.052951315 0.590481166 -0.038094460 -0.131453634
[76] 0.885293328 0.001292077 -0.975936423 -0.037557685 -0.220548524
[81] 0.512119223 -0.384559405 0.708506300 -0.833076985 0.877426556
[86] 0.897727331 -0.854452674 0.755895467 -2.078587666 0.892210169
[91] -0.092216454 1.601237432 0.342389950 0.938774147 -0.725845750
[96] 0.507795086 -0.567775403 -0.495219947 2.116209705 0.558135945
> colMin(tmp)
[1] 0.261771604 -0.195912628 0.127671137 0.490793517 -1.159297308
[6] 0.007082273 0.479951800 -1.084054639 0.867341767 0.414616853
[11] 1.783641966 -0.450676571 0.303818511 -2.905148714 0.581246351
[16] 0.308857359 0.363325587 -1.143355285 0.273918049 0.550279470
[21] -0.765253125 1.029148206 -0.249828823 0.312048269 -0.136475775
[26] 0.064795861 -1.237376590 -0.169155995 -1.154014468 -0.470254965
[31] 1.344875449 -1.430773180 -1.140835996 0.453367593 1.026932561
[36] 0.058506239 -1.280816602 1.136934007 0.028916639 -0.880759354
[41] 0.020818475 0.606602654 -0.376582140 0.248842911 -0.013230275
[46] 1.407398084 -0.015730214 -0.587349147 -0.778187527 -4.139373667
[51] -0.125437608 -0.116698599 -1.321107742 2.084639147 -0.198984838
[56] -0.392122172 -0.025262781 1.471285479 -1.122096230 -0.262402347
[61] 0.125810187 0.437280146 -0.879693107 -2.309380665 -0.476908797
[66] -0.643783660 -0.324635079 0.249150616 0.480644121 0.247372519
[71] -0.493326028 1.052951315 0.590481166 -0.038094460 -0.131453634
[76] 0.885293328 0.001292077 -0.975936423 -0.037557685 -0.220548524
[81] 0.512119223 -0.384559405 0.708506300 -0.833076985 0.877426556
[86] 0.897727331 -0.854452674 0.755895467 -2.078587666 0.892210169
[91] -0.092216454 1.601237432 0.342389950 0.938774147 -0.725845750
[96] 0.507795086 -0.567775403 -0.495219947 2.116209705 0.558135945
> colMedians(tmp)
[1] 0.261771604 -0.195912628 0.127671137 0.490793517 -1.159297308
[6] 0.007082273 0.479951800 -1.084054639 0.867341767 0.414616853
[11] 1.783641966 -0.450676571 0.303818511 -2.905148714 0.581246351
[16] 0.308857359 0.363325587 -1.143355285 0.273918049 0.550279470
[21] -0.765253125 1.029148206 -0.249828823 0.312048269 -0.136475775
[26] 0.064795861 -1.237376590 -0.169155995 -1.154014468 -0.470254965
[31] 1.344875449 -1.430773180 -1.140835996 0.453367593 1.026932561
[36] 0.058506239 -1.280816602 1.136934007 0.028916639 -0.880759354
[41] 0.020818475 0.606602654 -0.376582140 0.248842911 -0.013230275
[46] 1.407398084 -0.015730214 -0.587349147 -0.778187527 -4.139373667
[51] -0.125437608 -0.116698599 -1.321107742 2.084639147 -0.198984838
[56] -0.392122172 -0.025262781 1.471285479 -1.122096230 -0.262402347
[61] 0.125810187 0.437280146 -0.879693107 -2.309380665 -0.476908797
[66] -0.643783660 -0.324635079 0.249150616 0.480644121 0.247372519
[71] -0.493326028 1.052951315 0.590481166 -0.038094460 -0.131453634
[76] 0.885293328 0.001292077 -0.975936423 -0.037557685 -0.220548524
[81] 0.512119223 -0.384559405 0.708506300 -0.833076985 0.877426556
[86] 0.897727331 -0.854452674 0.755895467 -2.078587666 0.892210169
[91] -0.092216454 1.601237432 0.342389950 0.938774147 -0.725845750
[96] 0.507795086 -0.567775403 -0.495219947 2.116209705 0.558135945
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.2617716 -0.1959126 0.1276711 0.4907935 -1.159297 0.007082273 0.4799518
[2,] 0.2617716 -0.1959126 0.1276711 0.4907935 -1.159297 0.007082273 0.4799518
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.084055 0.8673418 0.4146169 1.783642 -0.4506766 0.3038185 -2.905149
[2,] -1.084055 0.8673418 0.4146169 1.783642 -0.4506766 0.3038185 -2.905149
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.5812464 0.3088574 0.3633256 -1.143355 0.273918 0.5502795 -0.7652531
[2,] 0.5812464 0.3088574 0.3633256 -1.143355 0.273918 0.5502795 -0.7652531
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.029148 -0.2498288 0.3120483 -0.1364758 0.06479586 -1.237377 -0.169156
[2,] 1.029148 -0.2498288 0.3120483 -0.1364758 0.06479586 -1.237377 -0.169156
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.154014 -0.470255 1.344875 -1.430773 -1.140836 0.4533676 1.026933
[2,] -1.154014 -0.470255 1.344875 -1.430773 -1.140836 0.4533676 1.026933
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.05850624 -1.280817 1.136934 0.02891664 -0.8807594 0.02081847 0.6066027
[2,] 0.05850624 -1.280817 1.136934 0.02891664 -0.8807594 0.02081847 0.6066027
[,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.3765821 0.2488429 -0.01323027 1.407398 -0.01573021 -0.5873491
[2,] -0.3765821 0.2488429 -0.01323027 1.407398 -0.01573021 -0.5873491
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.7781875 -4.139374 -0.1254376 -0.1166986 -1.321108 2.084639 -0.1989848
[2,] -0.7781875 -4.139374 -0.1254376 -0.1166986 -1.321108 2.084639 -0.1989848
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.3921222 -0.02526278 1.471285 -1.122096 -0.2624023 0.1258102 0.4372801
[2,] -0.3921222 -0.02526278 1.471285 -1.122096 -0.2624023 0.1258102 0.4372801
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.8796931 -2.309381 -0.4769088 -0.6437837 -0.3246351 0.2491506 0.4806441
[2,] -0.8796931 -2.309381 -0.4769088 -0.6437837 -0.3246351 0.2491506 0.4806441
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.2473725 -0.493326 1.052951 0.5904812 -0.03809446 -0.1314536 0.8852933
[2,] 0.2473725 -0.493326 1.052951 0.5904812 -0.03809446 -0.1314536 0.8852933
[,77] [,78] [,79] [,80] [,81] [,82]
[1,] 0.001292077 -0.9759364 -0.03755768 -0.2205485 0.5121192 -0.3845594
[2,] 0.001292077 -0.9759364 -0.03755768 -0.2205485 0.5121192 -0.3845594
[,83] [,84] [,85] [,86] [,87] [,88] [,89]
[1,] 0.7085063 -0.833077 0.8774266 0.8977273 -0.8544527 0.7558955 -2.078588
[2,] 0.7085063 -0.833077 0.8774266 0.8977273 -0.8544527 0.7558955 -2.078588
[,90] [,91] [,92] [,93] [,94] [,95] [,96]
[1,] 0.8922102 -0.09221645 1.601237 0.34239 0.9387741 -0.7258457 0.5077951
[2,] 0.8922102 -0.09221645 1.601237 0.34239 0.9387741 -0.7258457 0.5077951
[,97] [,98] [,99] [,100]
[1,] -0.5677754 -0.4952199 2.11621 0.5581359
[2,] -0.5677754 -0.4952199 2.11621 0.5581359
>
>
> Max(tmp2)
[1] 3.320183
> Min(tmp2)
[1] -2.165514
> mean(tmp2)
[1] 0.09966348
> Sum(tmp2)
[1] 9.966348
> Var(tmp2)
[1] 1.165751
>
> rowMeans(tmp2)
[1] 0.213647968 0.481252548 0.666996434 1.153346570 -0.580016038
[6] -0.709457478 0.673543471 -1.841979798 1.019805454 1.185853022
[11] 1.612807895 -0.596647797 -1.261096906 -0.157699387 0.992753529
[16] 1.401933451 -1.634813886 -0.075898768 3.320182715 -0.143644413
[21] 1.099152109 1.241923814 0.529971844 -2.165513815 -1.020130339
[26] -0.471234104 0.122835593 -0.005480549 -0.244700900 1.373178668
[31] -0.064845445 -0.513884539 1.328639731 0.138964098 1.298961345
[36] 0.814030207 0.459090061 1.610143967 0.575345040 -1.948325172
[41] -0.328854914 -0.489440563 -0.459674811 -0.071575335 0.297948519
[46] -1.904593770 -0.126926905 -0.391571117 -0.808327528 0.052807830
[51] -0.946899100 -1.834981263 -0.076629185 1.002472679 0.001946929
[56] 2.132504940 -0.896142254 -0.299868522 0.220911160 -0.195941614
[61] -0.148010771 1.874180173 -0.491857624 1.981896375 1.342929385
[66] -0.946141364 -0.541428982 -0.574108888 0.049055021 -1.378316879
[71] 0.616751667 0.882836744 0.445432499 1.778974412 1.170209771
[76] 1.711776436 1.173476543 0.969595533 0.605455669 -0.791422509
[81] 1.237821127 0.277312277 -1.245493770 -0.229998414 -1.658581602
[86] -0.346664532 1.667740130 1.335298194 0.372991994 -0.156217462
[91] 0.649556368 -0.587620347 0.132290559 0.347844519 -1.822753940
[96] 0.123446608 -2.005345430 -0.036385194 -1.693447183 -0.882884897
> rowSums(tmp2)
[1] 0.213647968 0.481252548 0.666996434 1.153346570 -0.580016038
[6] -0.709457478 0.673543471 -1.841979798 1.019805454 1.185853022
[11] 1.612807895 -0.596647797 -1.261096906 -0.157699387 0.992753529
[16] 1.401933451 -1.634813886 -0.075898768 3.320182715 -0.143644413
[21] 1.099152109 1.241923814 0.529971844 -2.165513815 -1.020130339
[26] -0.471234104 0.122835593 -0.005480549 -0.244700900 1.373178668
[31] -0.064845445 -0.513884539 1.328639731 0.138964098 1.298961345
[36] 0.814030207 0.459090061 1.610143967 0.575345040 -1.948325172
[41] -0.328854914 -0.489440563 -0.459674811 -0.071575335 0.297948519
[46] -1.904593770 -0.126926905 -0.391571117 -0.808327528 0.052807830
[51] -0.946899100 -1.834981263 -0.076629185 1.002472679 0.001946929
[56] 2.132504940 -0.896142254 -0.299868522 0.220911160 -0.195941614
[61] -0.148010771 1.874180173 -0.491857624 1.981896375 1.342929385
[66] -0.946141364 -0.541428982 -0.574108888 0.049055021 -1.378316879
[71] 0.616751667 0.882836744 0.445432499 1.778974412 1.170209771
[76] 1.711776436 1.173476543 0.969595533 0.605455669 -0.791422509
[81] 1.237821127 0.277312277 -1.245493770 -0.229998414 -1.658581602
[86] -0.346664532 1.667740130 1.335298194 0.372991994 -0.156217462
[91] 0.649556368 -0.587620347 0.132290559 0.347844519 -1.822753940
[96] 0.123446608 -2.005345430 -0.036385194 -1.693447183 -0.882884897
> 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.213647968 0.481252548 0.666996434 1.153346570 -0.580016038
[6] -0.709457478 0.673543471 -1.841979798 1.019805454 1.185853022
[11] 1.612807895 -0.596647797 -1.261096906 -0.157699387 0.992753529
[16] 1.401933451 -1.634813886 -0.075898768 3.320182715 -0.143644413
[21] 1.099152109 1.241923814 0.529971844 -2.165513815 -1.020130339
[26] -0.471234104 0.122835593 -0.005480549 -0.244700900 1.373178668
[31] -0.064845445 -0.513884539 1.328639731 0.138964098 1.298961345
[36] 0.814030207 0.459090061 1.610143967 0.575345040 -1.948325172
[41] -0.328854914 -0.489440563 -0.459674811 -0.071575335 0.297948519
[46] -1.904593770 -0.126926905 -0.391571117 -0.808327528 0.052807830
[51] -0.946899100 -1.834981263 -0.076629185 1.002472679 0.001946929
[56] 2.132504940 -0.896142254 -0.299868522 0.220911160 -0.195941614
[61] -0.148010771 1.874180173 -0.491857624 1.981896375 1.342929385
[66] -0.946141364 -0.541428982 -0.574108888 0.049055021 -1.378316879
[71] 0.616751667 0.882836744 0.445432499 1.778974412 1.170209771
[76] 1.711776436 1.173476543 0.969595533 0.605455669 -0.791422509
[81] 1.237821127 0.277312277 -1.245493770 -0.229998414 -1.658581602
[86] -0.346664532 1.667740130 1.335298194 0.372991994 -0.156217462
[91] 0.649556368 -0.587620347 0.132290559 0.347844519 -1.822753940
[96] 0.123446608 -2.005345430 -0.036385194 -1.693447183 -0.882884897
> rowMin(tmp2)
[1] 0.213647968 0.481252548 0.666996434 1.153346570 -0.580016038
[6] -0.709457478 0.673543471 -1.841979798 1.019805454 1.185853022
[11] 1.612807895 -0.596647797 -1.261096906 -0.157699387 0.992753529
[16] 1.401933451 -1.634813886 -0.075898768 3.320182715 -0.143644413
[21] 1.099152109 1.241923814 0.529971844 -2.165513815 -1.020130339
[26] -0.471234104 0.122835593 -0.005480549 -0.244700900 1.373178668
[31] -0.064845445 -0.513884539 1.328639731 0.138964098 1.298961345
[36] 0.814030207 0.459090061 1.610143967 0.575345040 -1.948325172
[41] -0.328854914 -0.489440563 -0.459674811 -0.071575335 0.297948519
[46] -1.904593770 -0.126926905 -0.391571117 -0.808327528 0.052807830
[51] -0.946899100 -1.834981263 -0.076629185 1.002472679 0.001946929
[56] 2.132504940 -0.896142254 -0.299868522 0.220911160 -0.195941614
[61] -0.148010771 1.874180173 -0.491857624 1.981896375 1.342929385
[66] -0.946141364 -0.541428982 -0.574108888 0.049055021 -1.378316879
[71] 0.616751667 0.882836744 0.445432499 1.778974412 1.170209771
[76] 1.711776436 1.173476543 0.969595533 0.605455669 -0.791422509
[81] 1.237821127 0.277312277 -1.245493770 -0.229998414 -1.658581602
[86] -0.346664532 1.667740130 1.335298194 0.372991994 -0.156217462
[91] 0.649556368 -0.587620347 0.132290559 0.347844519 -1.822753940
[96] 0.123446608 -2.005345430 -0.036385194 -1.693447183 -0.882884897
>
> colMeans(tmp2)
[1] 0.09966348
> colSums(tmp2)
[1] 9.966348
> colVars(tmp2)
[1] 1.165751
> colSd(tmp2)
[1] 1.079699
> colMax(tmp2)
[1] 3.320183
> colMin(tmp2)
[1] -2.165514
> colMedians(tmp2)
[1] 0.02550098
> colRanges(tmp2)
[,1]
[1,] -2.165514
[2,] 3.320183
>
> 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] -1.39707736 -3.91610745 1.24501178 4.05549028 2.52254737 1.90197638
[7] -0.06355953 -1.69192646 3.02834092 3.64843868
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.90379172
[2,] -0.44762915
[3,] -0.12071091
[4,] 0.05761381
[5,] 1.76004312
>
> rowApply(tmp,sum)
[1] 0.8362412 3.0852391 1.6564882 -0.1602136 0.1840158 0.4582560
[7] 1.0185788 0.4353819 2.4405149 -0.6213677
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 1 2 6 5 10 5 2 3 9
[2,] 1 3 1 10 2 8 4 8 2 7
[3,] 10 5 6 4 1 2 8 9 8 5
[4,] 3 10 10 7 8 1 6 7 9 4
[5,] 7 4 7 1 7 7 3 10 7 6
[6,] 6 6 9 2 3 5 10 5 5 2
[7,] 2 9 5 3 10 9 1 1 4 3
[8,] 8 2 8 8 4 3 2 4 1 8
[9,] 9 8 4 9 6 4 7 6 10 1
[10,] 5 7 3 5 9 6 9 3 6 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.0435191 -0.8513247 -5.0281541 3.7876155 1.9846268 1.4176616
[7] -0.9310208 -1.7983189 -3.6206870 0.6406154 -1.6198471 -0.4762573
[13] 1.5270434 3.9716031 -0.7912249 3.8588314 2.7324858 -2.0298711
[19] 3.3850600 -0.2564551
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.4554463
[2,] -0.2399351
[3,] 0.1039842
[4,] 0.9887411
[5,] 1.6461751
>
> rowApply(tmp,sum)
[1] 2.676236 -2.072038 3.092683 5.881279 -1.632259
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 8 18 6 17
[2,] 3 5 6 15 16
[3,] 12 14 1 1 2
[4,] 14 18 11 13 19
[5,] 17 11 19 5 8
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.1039842 -0.9152872 0.4803868 0.7929153 1.18416937 0.1308015
[2,] -0.4554463 -0.8319902 0.4118461 0.9229797 0.01550866 0.1884555
[3,] 1.6461751 -0.6465423 -2.5515100 0.3806765 1.68935164 1.3618067
[4,] -0.2399351 0.5865531 -1.4158422 0.4995463 -0.54197582 0.4571344
[5,] 0.9887411 0.9559419 -1.9530347 1.1914977 -0.36242701 -0.7205365
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.2821614 1.5332606 -2.5020621 -0.517448055 -0.2722594 -0.6121683
[2,] -0.0863246 -1.7272622 -0.9743700 0.762144532 -1.7175552 -0.7026684
[3,] -0.7678537 -1.0042411 0.4137295 0.006907207 -1.0291354 1.6169736
[4,] 0.3894290 0.5458477 -1.3824619 0.406450814 1.1518331 -0.1029846
[5,] -0.1841101 -1.1459239 0.8244774 -0.017439136 0.2472698 -0.6754095
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.8450700 1.2126379 0.6267540 -0.7786098 1.7092120 0.1157747
[2,] 0.8741971 0.9796811 -0.4965571 -0.4198618 0.2585745 -1.4928336
[3,] -0.4451138 1.6932989 0.9831895 0.9468968 0.3166389 -1.4068713
[4,] 0.9952368 0.4247197 -0.7736537 2.2122683 -0.5645766 0.1007478
[5,] -0.7423467 -0.3387344 -1.1309576 1.8981380 1.0126370 0.6533113
[,19] [,20]
[1,] 0.9519714 -1.1307051
[2,] 1.8324030 0.5870411
[3,] -0.5834171 0.4717230
[4,] 1.3302181 1.8027240
[5,] -0.1461154 -1.9872380
>
>
> 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 : 644 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 : 558 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 0.762269 0.05655204 -0.08379114 2.712233 1.52331 -1.910595 -1.56261
col8 col9 col10 col11 col12 col13 col14
row1 0.5411479 -0.06624942 -0.0967409 1.563729 -1.205522 -0.7543339 -0.6681079
col15 col16 col17 col18 col19 col20
row1 -0.6763288 0.08386215 -0.1634724 1.964974 1.140887 -0.04093904
> tmp[,"col10"]
col10
row1 -0.0967409
row2 -1.3486073
row3 -1.9145479
row4 0.7604546
row5 0.2503116
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.7622690 0.05655204 -0.08379114 2.7122328 1.5233104 -1.9105949
row5 -0.6077587 -1.36200436 0.02871079 -0.5441963 -0.1395907 0.3323273
col7 col8 col9 col10 col11 col12
row1 -1.5626104 0.5411479 -0.06624942 -0.0967409 1.5637288 -1.205522
row5 0.2769304 -0.4245218 0.26630900 0.2503116 -0.4072505 2.424023
col13 col14 col15 col16 col17 col18 col19
row1 -0.7543339 -0.6681079 -0.6763288 0.08386215 -0.1634724 1.9649743 1.140887
row5 -0.5142641 0.5878568 -0.7415431 1.22178382 -0.8286814 0.3654743 -1.759934
col20
row1 -0.04093904
row5 0.94609313
> tmp[,c("col6","col20")]
col6 col20
row1 -1.9105949 -0.04093904
row2 1.2155048 0.14091220
row3 -1.6002397 -0.46362328
row4 -0.9065207 0.67998947
row5 0.3323273 0.94609313
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.9105949 -0.04093904
row5 0.3323273 0.94609313
>
>
>
>
> 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.5044 50.99994 50.60935 50.54169 51.69956 105.5858 48.26786 48.89963
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.28826 51.86067 49.03844 50.48176 50.41932 50.21088 48.17796 49.99279
col17 col18 col19 col20
row1 52.34917 48.79198 50.93794 105.3077
> tmp[,"col10"]
col10
row1 51.86067
row2 27.78497
row3 29.83145
row4 30.51898
row5 52.09306
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.50440 50.99994 50.60935 50.54169 51.69956 105.5858 48.26786 48.89963
row5 47.89366 49.26051 50.14480 49.86606 51.29319 103.5940 49.61708 48.46406
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.28826 51.86067 49.03844 50.48176 50.41932 50.21088 48.17796 49.99279
row5 49.10560 52.09306 49.21129 48.48981 49.12712 50.15470 50.55847 49.35950
col17 col18 col19 col20
row1 52.34917 48.79198 50.93794 105.3077
row5 48.41307 50.91154 50.11362 105.3202
> tmp[,c("col6","col20")]
col6 col20
row1 105.58585 105.30774
row2 74.98415 75.27079
row3 76.19657 76.18992
row4 75.43850 72.39850
row5 103.59398 105.32024
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.5858 105.3077
row5 103.5940 105.3202
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.5858 105.3077
row5 103.5940 105.3202
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.5127075
[2,] -0.4172183
[3,] -1.7761199
[4,] -1.3869328
[5,] -0.3713330
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.6795150 -0.215997607
[2,] 0.0407745 0.563926281
[3,] -1.9490311 0.005903796
[4,] 0.4683671 -0.575606869
[5,] 1.9247167 -0.762220445
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.5301466 1.3654805
[2,] -0.0848108 0.4789546
[3,] -0.5680591 -0.0854226
[4,] 2.3652200 -0.2653978
[5,] -0.2453421 -0.7408048
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.5301466
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.5301466
[2,] -0.0848108
>
>
>
> 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.1131361 0.1943071 1.8921846 -0.4732628 -1.546220 0.4327460 0.05759139
row1 -0.7534490 -1.5432358 0.3720299 -1.5864029 1.074309 0.1639254 1.18252251
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.5934382 -0.4275229 -0.3253557 -0.8367428 -1.15790805 1.4113227
row1 -0.6158595 -0.6454653 0.5230450 0.1369576 -0.08399638 -0.6709983
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.3838245 -0.7969230 1.995100 0.7192199 0.06532917 -1.5380591 -0.7458867
row1 -0.4729124 -0.7574198 1.951308 0.1470528 0.93340668 -0.7248301 0.1275061
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.258516 -1.539908 0.1244089 -0.7802285 0.5113867 1.300414 -0.5105479
[,8] [,9] [,10]
row2 0.7339645 0.9270361 0.01351734
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 2.379226 -1.168473 -0.1526294 0.6631025 0.47468 2.594664 0.9171325
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.5621911 -1.384989 0.07700889 1.705857 -0.9194978 -0.3792063 0.5767263
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.221433 -0.1451319 0.4076325 -2.922298 1.597734 -0.7516458
>
>
> 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: 0xbe0590600>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb835bb3de92"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb837dd97246"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb834edd9236"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb8334aa3fad"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb83153a91de"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb83383e90b5"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb83138e77ec"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb836e6330fb"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb833224e75b"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb8314d12115"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb832dd2f460"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb8374a9e220"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb833d3cdeb6"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb8367419e22"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMb834f4ff24"
>
>
> ### 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: 0xbe05910e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xbe05910e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xbe05910e0>
> rowMedians(tmp)
[1] -0.5769518872 -0.2198067188 0.6614635845 0.4907830437 0.4684425888
[6] -0.0187027915 -0.8716147861 -0.1030110990 -0.0508004667 0.4849659235
[11] 0.3360768270 0.3494600268 0.3426967589 -0.4223718544 -0.1803117056
[16] -0.2961913318 -0.0041720040 -0.3676281125 -0.0621627236 -0.2299560376
[21] -0.1608867240 -0.5138390544 0.0278823074 -0.0992443824 -0.0544338092
[26] -0.2336018291 0.1764800538 0.0015783669 -0.3906248675 0.4461038901
[31] -0.0651161508 -0.3276317316 0.2469058569 -0.1608808102 -0.5022026113
[36] 0.1958371420 -0.6486491182 -0.3037783595 0.4584902720 -0.6881362449
[41] -0.0012291242 -0.0434462882 -0.0366042860 -0.6736580258 0.5953811723
[46] 0.5880153264 -0.0553779688 0.0011072108 0.2973518528 -0.0273577127
[51] -0.5255465954 0.1857212529 -0.3830415856 -0.1797696645 0.0657462696
[56] 0.3997920441 0.2745438616 0.1258193948 0.2195033751 0.4395812969
[61] -0.0836866281 -0.5708311953 -0.0549335892 0.2014882254 -0.4229587459
[66] -0.0653349807 -0.0297227130 0.4496618200 0.0533356570 0.0962576820
[71] -0.6390588527 -0.3897854076 0.1905569720 0.1629293553 0.3632233260
[76] -0.4808593096 0.5669332966 0.1312626020 -0.0173964884 0.1986180565
[81] -0.0441832163 0.2421142674 -0.2941577109 0.0848717523 0.8806003290
[86] -0.4522911531 0.4181544678 -0.1379843242 -0.0230045376 0.2759697328
[91] 0.1760856234 -0.3392616552 -0.0404614919 -0.3123847176 0.1949135008
[96] 0.2599593784 -0.5169086827 0.4320403154 -0.1238937275 -0.0397726228
[101] 0.2596530739 -0.2022612596 0.1131670260 -0.2274258975 -0.0945047584
[106] -0.5410944686 -0.0632436441 0.1696786241 0.5083589718 0.0636412629
[111] 0.9184864464 -0.0822894377 -0.3529153668 0.1707793323 -0.0792609458
[116] 0.0625567977 -0.0730530802 -0.0275623538 -0.0712013118 0.2413005311
[121] 0.0710465387 0.0060194135 -0.2822035312 0.0389505471 0.2385503752
[126] -0.2595268297 0.0422317478 0.7051184764 0.3475025703 -0.0516339417
[131] 0.2340879756 0.1298749781 0.6037949543 -0.1135262874 0.1515175119
[136] -0.1054361015 -0.2897653027 -0.1208312863 0.4407388245 -0.0929257256
[141] 0.0378189006 0.0776369685 0.7502666614 0.3135383269 -0.0860198566
[146] 0.1554096677 -0.2802194701 0.1630178828 0.2126831925 -0.2543290764
[151] -0.0430155656 -0.2352202337 0.5085335132 0.1549899856 -0.6805102131
[156] 0.2023308738 -0.1354650054 -0.2584204206 0.0898190521 -0.3608603220
[161] 0.2591701024 0.4241420193 -0.1696745349 0.1672495419 -0.0858872543
[166] 0.2198698033 0.0003168085 0.6877996396 -0.4530916705 0.2802856972
[171] -0.5499243363 0.2886089406 -0.1803707190 0.3154874052 0.2053566194
[176] 0.0402366855 0.5146742626 0.1331035216 -0.8626384899 -0.1026297836
[181] -0.3795728560 -0.3692431679 -0.0489120677 -0.0630441001 0.2512563512
[186] 0.5356031520 0.1723687499 0.1718835373 0.1685175578 0.1661148462
[191] -0.2853015396 -0.1438013878 -0.2305970419 0.3252969265 0.6001938475
[196] -0.0270474161 -0.0214029007 -0.3795324051 -0.2184190140 0.3866088986
[201] -0.5134135960 -0.2212932829 -0.3235238636 0.3043566913 0.0162337902
[206] -0.0318308983 0.0801451845 -0.1435380196 -0.2712966683 0.1284554257
[211] 0.0666039558 -0.0276904592 -0.6351444404 0.5353715299 -0.2512660170
[216] 0.2147248179 0.1841310180 -0.1216381498 0.4443940311 -0.3077848380
[221] -0.2919457840 0.2823941615 -0.0033847704 0.2652120629 -0.1066145347
[226] 0.3356613576 0.5987612391 -0.5229397029 0.0460093701 -0.3635435863
>
> proc.time()
user system elapsed
0.749 4.979 5.816
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 alpha (2026-03-28 r89739)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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: 0x1021d0420>
> .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: 0x1021d0420>
> .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: 0x1021d0420>
> .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: 0x1021d0420>
> 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: 0x92a4b4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4000>
> .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: 0x92a4b4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4000>
> .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: 0x92a4b4000>
> 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: 0x92a4b4240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4240>
> .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: 0x92a4b4240>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x92a4b4240>
> .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: 0x92a4b4240>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x92a4b4240>
> .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: 0x92a4b4240>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x92a4b4240>
> .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: 0x92a4b4240>
> 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: 0x92a4b4360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x92a4b4360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecd019d680a3" "BufferedMatrixFilecd046a1936f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecd019d680a3" "BufferedMatrixFilecd046a1936f"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4480>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x92a4b4480>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x92a4b4480>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x92a4b4480>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x92a4b4480>
> .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: 0x92a4b4600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x92a4b4600>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x92a4b4600>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x92a4b4600>
> 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: 0x92a4b4720>
> .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: 0x92a4b4720>
> rm(P)
>
> proc.time()
user system elapsed
0.134 0.057 0.190
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 alpha (2026-03-28 r89739)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.121 0.031 0.149