| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-06 11:35 -0500 (Fri, 06 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4891 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4593 |
| 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 255/2357 | 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-05 18:48:20 -0500 (Thu, 05 Mar 2026) |
| EndedAt: 2026-03-05 18:48:39 -0500 (Thu, 05 Mar 2026) |
| EllapsedTime: 19.3 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) (2026-01-15 r89304)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Sonoma 14.8.3
* 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 15.0.0 (clang-1500.1.0.2.5)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -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=gnu2x -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]
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 arm64 -std=gnu2x -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=gnu2x -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=gnu2x -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-arm64/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) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-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.153 0.051 0.199
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-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 481350 25.8 1058420 56.6 NA 633731 33.9
Vcells 891641 6.9 8388608 64.0 196608 2111462 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 Mar 5 18:48:31 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] "Thu Mar 5 18:48:31 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: 0x60000214c000>
>
>
>
> 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 Mar 5 18:48:32 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] "Thu Mar 5 18:48:33 2026"
>
> ColMode(tmp2)
<pointer: 0x60000214c000>
>
>
>
> ### 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,] 101.1674729 -1.6487044 0.8142643 1.6592348
[2,] -1.2321667 -0.3177205 -1.2761308 -0.7119585
[3,] -0.4906591 -0.7723535 -0.5278625 1.0100556
[4,] -1.6902154 -2.2367136 0.9056540 -0.2869971
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.1674729 1.6487044 0.8142643 1.6592348
[2,] 1.2321667 0.3177205 1.2761308 0.7119585
[3,] 0.4906591 0.7723535 0.5278625 1.0100556
[4,] 1.6902154 2.2367136 0.9056540 0.2869971
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0582043 1.2840188 0.9023659 1.2881129
[2,] 1.1100300 0.5636670 1.1296596 0.8437764
[3,] 0.7004707 0.8788364 0.7265415 1.0050152
[4,] 1.3000828 1.4955646 0.9516585 0.5357211
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.74952 39.48889 34.83792 39.54036
[2,] 37.33247 30.95439 37.57273 34.14972
[3,] 32.49537 34.56072 32.79328 36.06021
[4,] 39.69104 42.19236 35.42224 30.64421
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002148000>
> exp(tmp5)
<pointer: 0x600002148000>
> log(tmp5,2)
<pointer: 0x600002148000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.9494
> Min(tmp5)
[1] 52.662
> mean(tmp5)
[1] 72.44233
> Sum(tmp5)
[1] 14488.47
> Var(tmp5)
[1] 874.2139
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 92.46789 72.19153 71.06603 70.34511 68.37621 69.57691 68.51898 69.99415
[9] 71.02270 70.86375
> rowSums(tmp5)
[1] 1849.358 1443.831 1421.321 1406.902 1367.524 1391.538 1370.380 1399.883
[9] 1420.454 1417.275
> rowVars(tmp5)
[1] 8063.74803 71.12127 45.88854 70.72573 42.42184 59.97286
[7] 78.41904 111.31238 78.30582 52.20267
> rowSd(tmp5)
[1] 89.798374 8.433343 6.774108 8.409859 6.513205 7.744215 8.855453
[8] 10.550468 8.849058 7.225141
> rowMax(tmp5)
[1] 471.94941 87.44336 81.92150 87.81787 80.55495 89.73174 84.74407
[8] 87.97786 86.81629 84.19604
> rowMin(tmp5)
[1] 54.10092 59.13750 58.29883 56.13129 57.15917 55.53233 54.86424 52.66200
[9] 56.99147 59.00774
>
> colMeans(tmp5)
[1] 110.97215 73.26951 75.98996 70.46987 66.35192 67.36603 72.63934
[8] 67.59533 72.03727 74.95818 67.81792 70.21906 67.26599 72.41616
[15] 69.50964 66.94749 71.54730 69.02738 69.82569 72.62033
> colSums(tmp5)
[1] 1109.7215 732.6951 759.8996 704.6987 663.5192 673.6603 726.3934
[8] 675.9533 720.3727 749.5818 678.1792 702.1906 672.6599 724.1616
[15] 695.0964 669.4749 715.4730 690.2738 698.2569 726.2033
> colVars(tmp5)
[1] 16211.56826 75.53624 72.68975 41.23172 76.92088 68.58678
[7] 66.17679 70.54562 96.82021 23.32990 53.04696 62.94412
[13] 60.13075 89.31291 61.39197 36.14403 76.37209 36.22705
[19] 64.90288 90.56758
> colSd(tmp5)
[1] 127.324657 8.691159 8.525828 6.421193 8.770455 8.281714
[7] 8.134912 8.399144 9.839726 4.830104 7.283334 7.933733
[13] 7.754402 9.450551 7.835303 6.011990 8.739113 6.018891
[19] 8.056232 9.516700
> colMax(tmp5)
[1] 471.94941 87.81787 89.73174 82.29809 79.32216 81.19622 87.44336
[8] 78.58747 87.97786 84.34936 76.74118 87.31818 81.39733 83.47537
[15] 78.35696 75.73280 89.01315 79.69943 83.84136 84.74407
> colMin(tmp5)
[1] 54.86424 58.47491 59.00774 59.78816 54.10092 58.29883 58.66924 52.66200
[9] 58.52932 69.03792 55.53233 61.85929 56.13129 56.99147 58.75909 59.00700
[17] 62.25883 61.79517 53.61516 57.46963
>
>
> ### 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] 92.46789 72.19153 71.06603 70.34511 68.37621 69.57691 NA 69.99415
[9] 71.02270 70.86375
> rowSums(tmp5)
[1] 1849.358 1443.831 1421.321 1406.902 1367.524 1391.538 NA 1399.883
[9] 1420.454 1417.275
> rowVars(tmp5)
[1] 8063.74803 71.12127 45.88854 70.72573 42.42184 59.97286
[7] 73.93704 111.31238 78.30582 52.20267
> rowSd(tmp5)
[1] 89.798374 8.433343 6.774108 8.409859 6.513205 7.744215 8.598665
[8] 10.550468 8.849058 7.225141
> rowMax(tmp5)
[1] 471.94941 87.44336 81.92150 87.81787 80.55495 89.73174 NA
[8] 87.97786 86.81629 84.19604
> rowMin(tmp5)
[1] 54.10092 59.13750 58.29883 56.13129 57.15917 55.53233 NA 52.66200
[9] 56.99147 59.00774
>
> colMeans(tmp5)
[1] 110.97215 73.26951 NA 70.46987 66.35192 67.36603 72.63934
[8] 67.59533 72.03727 74.95818 67.81792 70.21906 67.26599 72.41616
[15] 69.50964 66.94749 71.54730 69.02738 69.82569 72.62033
> colSums(tmp5)
[1] 1109.7215 732.6951 NA 704.6987 663.5192 673.6603 726.3934
[8] 675.9533 720.3727 749.5818 678.1792 702.1906 672.6599 724.1616
[15] 695.0964 669.4749 715.4730 690.2738 698.2569 726.2033
> colVars(tmp5)
[1] 16211.56826 75.53624 NA 41.23172 76.92088 68.58678
[7] 66.17679 70.54562 96.82021 23.32990 53.04696 62.94412
[13] 60.13075 89.31291 61.39197 36.14403 76.37209 36.22705
[19] 64.90288 90.56758
> colSd(tmp5)
[1] 127.324657 8.691159 NA 6.421193 8.770455 8.281714
[7] 8.134912 8.399144 9.839726 4.830104 7.283334 7.933733
[13] 7.754402 9.450551 7.835303 6.011990 8.739113 6.018891
[19] 8.056232 9.516700
> colMax(tmp5)
[1] 471.94941 87.81787 NA 82.29809 79.32216 81.19622 87.44336
[8] 78.58747 87.97786 84.34936 76.74118 87.31818 81.39733 83.47537
[15] 78.35696 75.73280 89.01315 79.69943 83.84136 84.74407
> colMin(tmp5)
[1] 54.86424 58.47491 NA 59.78816 54.10092 58.29883 58.66924 52.66200
[9] 58.52932 69.03792 55.53233 61.85929 56.13129 56.99147 58.75909 59.00700
[17] 62.25883 61.79517 53.61516 57.46963
>
> Max(tmp5,na.rm=TRUE)
[1] 471.9494
> Min(tmp5,na.rm=TRUE)
[1] 52.662
> mean(tmp5,na.rm=TRUE)
[1] 72.40026
> Sum(tmp5,na.rm=TRUE)
[1] 14407.65
> Var(tmp5,na.rm=TRUE)
[1] 878.2734
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.46789 72.19153 71.06603 70.34511 68.37621 69.57691 67.87194 69.99415
[9] 71.02270 70.86375
> rowSums(tmp5,na.rm=TRUE)
[1] 1849.358 1443.831 1421.321 1406.902 1367.524 1391.538 1289.567 1399.883
[9] 1420.454 1417.275
> rowVars(tmp5,na.rm=TRUE)
[1] 8063.74803 71.12127 45.88854 70.72573 42.42184 59.97286
[7] 73.93704 111.31238 78.30582 52.20267
> rowSd(tmp5,na.rm=TRUE)
[1] 89.798374 8.433343 6.774108 8.409859 6.513205 7.744215 8.598665
[8] 10.550468 8.849058 7.225141
> rowMax(tmp5,na.rm=TRUE)
[1] 471.94941 87.44336 81.92150 87.81787 80.55495 89.73174 84.74407
[8] 87.97786 86.81629 84.19604
> rowMin(tmp5,na.rm=TRUE)
[1] 54.10092 59.13750 58.29883 56.13129 57.15917 55.53233 54.86424 52.66200
[9] 56.99147 59.00774
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.97215 73.26951 75.45408 70.46987 66.35192 67.36603 72.63934
[8] 67.59533 72.03727 74.95818 67.81792 70.21906 67.26599 72.41616
[15] 69.50964 66.94749 71.54730 69.02738 69.82569 72.62033
> colSums(tmp5,na.rm=TRUE)
[1] 1109.7215 732.6951 679.0867 704.6987 663.5192 673.6603 726.3934
[8] 675.9533 720.3727 749.5818 678.1792 702.1906 672.6599 724.1616
[15] 695.0964 669.4749 715.4730 690.2738 698.2569 726.2033
> colVars(tmp5,na.rm=TRUE)
[1] 16211.56826 75.53624 78.54531 41.23172 76.92088 68.58678
[7] 66.17679 70.54562 96.82021 23.32990 53.04696 62.94412
[13] 60.13075 89.31291 61.39197 36.14403 76.37209 36.22705
[19] 64.90288 90.56758
> colSd(tmp5,na.rm=TRUE)
[1] 127.324657 8.691159 8.862579 6.421193 8.770455 8.281714
[7] 8.134912 8.399144 9.839726 4.830104 7.283334 7.933733
[13] 7.754402 9.450551 7.835303 6.011990 8.739113 6.018891
[19] 8.056232 9.516700
> colMax(tmp5,na.rm=TRUE)
[1] 471.94941 87.81787 89.73174 82.29809 79.32216 81.19622 87.44336
[8] 78.58747 87.97786 84.34936 76.74118 87.31818 81.39733 83.47537
[15] 78.35696 75.73280 89.01315 79.69943 83.84136 84.74407
> colMin(tmp5,na.rm=TRUE)
[1] 54.86424 58.47491 59.00774 59.78816 54.10092 58.29883 58.66924 52.66200
[9] 58.52932 69.03792 55.53233 61.85929 56.13129 56.99147 58.75909 59.00700
[17] 62.25883 61.79517 53.61516 57.46963
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.46789 72.19153 71.06603 70.34511 68.37621 69.57691 NaN 69.99415
[9] 71.02270 70.86375
> rowSums(tmp5,na.rm=TRUE)
[1] 1849.358 1443.831 1421.321 1406.902 1367.524 1391.538 0.000 1399.883
[9] 1420.454 1417.275
> rowVars(tmp5,na.rm=TRUE)
[1] 8063.74803 71.12127 45.88854 70.72573 42.42184 59.97286
[7] NA 111.31238 78.30582 52.20267
> rowSd(tmp5,na.rm=TRUE)
[1] 89.798374 8.433343 6.774108 8.409859 6.513205 7.744215 NA
[8] 10.550468 8.849058 7.225141
> rowMax(tmp5,na.rm=TRUE)
[1] 471.94941 87.44336 81.92150 87.81787 80.55495 89.73174 NA
[8] 87.97786 86.81629 84.19604
> rowMin(tmp5,na.rm=TRUE)
[1] 54.10092 59.13750 58.29883 56.13129 57.15917 55.53233 NA 52.66200
[9] 56.99147 59.00774
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 117.20637 73.89455 NaN 71.65672 66.03109 68.14185 74.19157
[8] 66.89204 72.34831 74.68144 66.82645 71.14792 68.01131 71.21261
[15] 70.61233 66.16206 72.02381 69.17524 70.62207 71.27325
> colSums(tmp5,na.rm=TRUE)
[1] 1054.8573 665.0510 0.0000 644.9105 594.2798 613.2766 667.7242
[8] 602.0284 651.1348 672.1329 601.4380 640.3313 612.1018 640.9135
[15] 635.5109 595.4586 648.2143 622.5771 635.5986 641.4592
> colVars(tmp5,na.rm=TRUE)
[1] 17800.77851 80.58314 NA 30.53861 85.37799 70.38877
[7] 47.34282 73.79942 107.83433 25.38456 48.61886 61.10578
[13] 61.39770 84.18097 55.38681 33.72203 83.36423 40.50950
[19] 65.88086 81.47394
> colSd(tmp5,na.rm=TRUE)
[1] 133.419558 8.976811 NA 5.526175 9.240021 8.389801
[7] 6.880612 8.590659 10.384331 5.038309 6.972723 7.817019
[13] 7.835668 9.175019 7.442232 5.807067 9.130401 6.364707
[19] 8.116703 9.026291
> colMax(tmp5,na.rm=TRUE)
[1] 471.94941 87.81787 -Inf 82.29809 79.32216 81.19622 87.44336
[8] 78.58747 87.97786 84.34936 74.90084 87.31818 81.39733 83.47537
[15] 78.35696 75.73280 89.01315 79.69943 83.84136 81.92150
> colMin(tmp5,na.rm=TRUE)
[1] 57.86998 58.47491 Inf 63.78190 54.10092 58.29883 65.99712 52.66200
[9] 58.52932 69.03792 55.53233 61.95868 56.13129 56.99147 58.75909 59.00700
[17] 62.25883 61.79517 53.61516 57.46963
>
>
>
>
> 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] 273.0650 221.3775 233.8853 417.7457 341.0752 334.7955 163.2059 192.4261
[9] 244.3725 254.2402
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 273.0650 221.3775 233.8853 417.7457 341.0752 334.7955 163.2059 192.4261
[9] 244.3725 254.2402
>
>
>
> 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] 0.000000e+00 5.329071e-14 2.842171e-14 8.526513e-14 -8.526513e-14
[6] -2.842171e-14 -1.421085e-14 1.136868e-13 -8.526513e-14 0.000000e+00
[11] 0.000000e+00 1.421085e-14 1.705303e-13 0.000000e+00 5.684342e-14
[16] 1.989520e-13 -1.136868e-13 2.273737e-13 -5.684342e-14 -8.526513e-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)
+ }
6 8
9 9
9 20
3 14
4 9
4 10
8 16
9 5
2 7
7 1
5 10
8 1
7 19
2 12
8 10
6 9
2 20
8 11
9 18
10 18
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.458695
> Min(tmp)
[1] -2.740274
> mean(tmp)
[1] 0.1324366
> Sum(tmp)
[1] 13.24366
> Var(tmp)
[1] 0.9124466
>
> rowMeans(tmp)
[1] 0.1324366
> rowSums(tmp)
[1] 13.24366
> rowVars(tmp)
[1] 0.9124466
> rowSd(tmp)
[1] 0.9552207
> rowMax(tmp)
[1] 2.458695
> rowMin(tmp)
[1] -2.740274
>
> colMeans(tmp)
[1] 0.48698730 0.07896504 -1.48351945 0.15181389 0.45008413 -0.95760820
[7] 0.79891780 0.08834920 0.17553129 1.02724384 0.03280713 1.28626735
[13] 0.28707896 0.02903545 -0.96392150 0.86634117 0.52696297 -0.37271860
[19] 1.22194916 -0.64726516 0.85242318 0.47425300 -0.56012553 -0.57493790
[25] 1.22936415 0.08287615 0.64402246 -0.43413810 0.15909303 1.52378916
[31] 2.21155596 0.63730148 1.43814002 1.85530640 1.20467924 -1.43447803
[37] 1.09739340 0.38382766 1.33068245 0.64330451 0.73500458 0.46455732
[43] 0.86689884 -0.59320465 0.63154051 -0.07133868 0.23457846 0.46553316
[49] -0.60404941 -0.69371333 -1.07821554 0.05318906 1.48770555 0.35398129
[55] 1.38837998 -0.64146562 0.15843534 0.36043082 -0.12123355 -1.54843690
[61] 1.13735216 -0.26800968 -0.10192581 -1.27608214 0.42817469 -0.77947173
[67] -1.69522596 0.78996470 0.92509626 -1.72088806 -0.54921952 -0.19723856
[73] 2.45869485 0.97634371 0.74346797 0.28843163 0.98019321 0.64998082
[79] -0.60141510 0.87619220 -1.38892782 0.77133539 -0.95127001 1.81462464
[85] -0.14838581 -0.12061742 0.14681113 0.96941206 -0.57152799 -0.21113139
[91] -0.61914084 -0.41008899 0.48110267 -0.35966333 -1.63761072 -1.49479880
[97] -1.02439984 0.77464543 -0.79706610 -2.74027377
> colSums(tmp)
[1] 0.48698730 0.07896504 -1.48351945 0.15181389 0.45008413 -0.95760820
[7] 0.79891780 0.08834920 0.17553129 1.02724384 0.03280713 1.28626735
[13] 0.28707896 0.02903545 -0.96392150 0.86634117 0.52696297 -0.37271860
[19] 1.22194916 -0.64726516 0.85242318 0.47425300 -0.56012553 -0.57493790
[25] 1.22936415 0.08287615 0.64402246 -0.43413810 0.15909303 1.52378916
[31] 2.21155596 0.63730148 1.43814002 1.85530640 1.20467924 -1.43447803
[37] 1.09739340 0.38382766 1.33068245 0.64330451 0.73500458 0.46455732
[43] 0.86689884 -0.59320465 0.63154051 -0.07133868 0.23457846 0.46553316
[49] -0.60404941 -0.69371333 -1.07821554 0.05318906 1.48770555 0.35398129
[55] 1.38837998 -0.64146562 0.15843534 0.36043082 -0.12123355 -1.54843690
[61] 1.13735216 -0.26800968 -0.10192581 -1.27608214 0.42817469 -0.77947173
[67] -1.69522596 0.78996470 0.92509626 -1.72088806 -0.54921952 -0.19723856
[73] 2.45869485 0.97634371 0.74346797 0.28843163 0.98019321 0.64998082
[79] -0.60141510 0.87619220 -1.38892782 0.77133539 -0.95127001 1.81462464
[85] -0.14838581 -0.12061742 0.14681113 0.96941206 -0.57152799 -0.21113139
[91] -0.61914084 -0.41008899 0.48110267 -0.35966333 -1.63761072 -1.49479880
[97] -1.02439984 0.77464543 -0.79706610 -2.74027377
> 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.48698730 0.07896504 -1.48351945 0.15181389 0.45008413 -0.95760820
[7] 0.79891780 0.08834920 0.17553129 1.02724384 0.03280713 1.28626735
[13] 0.28707896 0.02903545 -0.96392150 0.86634117 0.52696297 -0.37271860
[19] 1.22194916 -0.64726516 0.85242318 0.47425300 -0.56012553 -0.57493790
[25] 1.22936415 0.08287615 0.64402246 -0.43413810 0.15909303 1.52378916
[31] 2.21155596 0.63730148 1.43814002 1.85530640 1.20467924 -1.43447803
[37] 1.09739340 0.38382766 1.33068245 0.64330451 0.73500458 0.46455732
[43] 0.86689884 -0.59320465 0.63154051 -0.07133868 0.23457846 0.46553316
[49] -0.60404941 -0.69371333 -1.07821554 0.05318906 1.48770555 0.35398129
[55] 1.38837998 -0.64146562 0.15843534 0.36043082 -0.12123355 -1.54843690
[61] 1.13735216 -0.26800968 -0.10192581 -1.27608214 0.42817469 -0.77947173
[67] -1.69522596 0.78996470 0.92509626 -1.72088806 -0.54921952 -0.19723856
[73] 2.45869485 0.97634371 0.74346797 0.28843163 0.98019321 0.64998082
[79] -0.60141510 0.87619220 -1.38892782 0.77133539 -0.95127001 1.81462464
[85] -0.14838581 -0.12061742 0.14681113 0.96941206 -0.57152799 -0.21113139
[91] -0.61914084 -0.41008899 0.48110267 -0.35966333 -1.63761072 -1.49479880
[97] -1.02439984 0.77464543 -0.79706610 -2.74027377
> colMin(tmp)
[1] 0.48698730 0.07896504 -1.48351945 0.15181389 0.45008413 -0.95760820
[7] 0.79891780 0.08834920 0.17553129 1.02724384 0.03280713 1.28626735
[13] 0.28707896 0.02903545 -0.96392150 0.86634117 0.52696297 -0.37271860
[19] 1.22194916 -0.64726516 0.85242318 0.47425300 -0.56012553 -0.57493790
[25] 1.22936415 0.08287615 0.64402246 -0.43413810 0.15909303 1.52378916
[31] 2.21155596 0.63730148 1.43814002 1.85530640 1.20467924 -1.43447803
[37] 1.09739340 0.38382766 1.33068245 0.64330451 0.73500458 0.46455732
[43] 0.86689884 -0.59320465 0.63154051 -0.07133868 0.23457846 0.46553316
[49] -0.60404941 -0.69371333 -1.07821554 0.05318906 1.48770555 0.35398129
[55] 1.38837998 -0.64146562 0.15843534 0.36043082 -0.12123355 -1.54843690
[61] 1.13735216 -0.26800968 -0.10192581 -1.27608214 0.42817469 -0.77947173
[67] -1.69522596 0.78996470 0.92509626 -1.72088806 -0.54921952 -0.19723856
[73] 2.45869485 0.97634371 0.74346797 0.28843163 0.98019321 0.64998082
[79] -0.60141510 0.87619220 -1.38892782 0.77133539 -0.95127001 1.81462464
[85] -0.14838581 -0.12061742 0.14681113 0.96941206 -0.57152799 -0.21113139
[91] -0.61914084 -0.41008899 0.48110267 -0.35966333 -1.63761072 -1.49479880
[97] -1.02439984 0.77464543 -0.79706610 -2.74027377
> colMedians(tmp)
[1] 0.48698730 0.07896504 -1.48351945 0.15181389 0.45008413 -0.95760820
[7] 0.79891780 0.08834920 0.17553129 1.02724384 0.03280713 1.28626735
[13] 0.28707896 0.02903545 -0.96392150 0.86634117 0.52696297 -0.37271860
[19] 1.22194916 -0.64726516 0.85242318 0.47425300 -0.56012553 -0.57493790
[25] 1.22936415 0.08287615 0.64402246 -0.43413810 0.15909303 1.52378916
[31] 2.21155596 0.63730148 1.43814002 1.85530640 1.20467924 -1.43447803
[37] 1.09739340 0.38382766 1.33068245 0.64330451 0.73500458 0.46455732
[43] 0.86689884 -0.59320465 0.63154051 -0.07133868 0.23457846 0.46553316
[49] -0.60404941 -0.69371333 -1.07821554 0.05318906 1.48770555 0.35398129
[55] 1.38837998 -0.64146562 0.15843534 0.36043082 -0.12123355 -1.54843690
[61] 1.13735216 -0.26800968 -0.10192581 -1.27608214 0.42817469 -0.77947173
[67] -1.69522596 0.78996470 0.92509626 -1.72088806 -0.54921952 -0.19723856
[73] 2.45869485 0.97634371 0.74346797 0.28843163 0.98019321 0.64998082
[79] -0.60141510 0.87619220 -1.38892782 0.77133539 -0.95127001 1.81462464
[85] -0.14838581 -0.12061742 0.14681113 0.96941206 -0.57152799 -0.21113139
[91] -0.61914084 -0.41008899 0.48110267 -0.35966333 -1.63761072 -1.49479880
[97] -1.02439984 0.77464543 -0.79706610 -2.74027377
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.4869873 0.07896504 -1.483519 0.1518139 0.4500841 -0.9576082 0.7989178
[2,] 0.4869873 0.07896504 -1.483519 0.1518139 0.4500841 -0.9576082 0.7989178
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.0883492 0.1755313 1.027244 0.03280713 1.286267 0.287079 0.02903545
[2,] 0.0883492 0.1755313 1.027244 0.03280713 1.286267 0.287079 0.02903545
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.9639215 0.8663412 0.526963 -0.3727186 1.221949 -0.6472652 0.8524232
[2,] -0.9639215 0.8663412 0.526963 -0.3727186 1.221949 -0.6472652 0.8524232
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.474253 -0.5601255 -0.5749379 1.229364 0.08287615 0.6440225 -0.4341381
[2,] 0.474253 -0.5601255 -0.5749379 1.229364 0.08287615 0.6440225 -0.4341381
[,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36]
[1,] 0.159093 1.523789 2.211556 0.6373015 1.43814 1.855306 1.204679 -1.434478
[2,] 0.159093 1.523789 2.211556 0.6373015 1.43814 1.855306 1.204679 -1.434478
[,37] [,38] [,39] [,40] [,41] [,42] [,43]
[1,] 1.097393 0.3838277 1.330682 0.6433045 0.7350046 0.4645573 0.8668988
[2,] 1.097393 0.3838277 1.330682 0.6433045 0.7350046 0.4645573 0.8668988
[,44] [,45] [,46] [,47] [,48] [,49] [,50]
[1,] -0.5932046 0.6315405 -0.07133868 0.2345785 0.4655332 -0.6040494 -0.6937133
[2,] -0.5932046 0.6315405 -0.07133868 0.2345785 0.4655332 -0.6040494 -0.6937133
[,51] [,52] [,53] [,54] [,55] [,56] [,57]
[1,] -1.078216 0.05318906 1.487706 0.3539813 1.38838 -0.6414656 0.1584353
[2,] -1.078216 0.05318906 1.487706 0.3539813 1.38838 -0.6414656 0.1584353
[,58] [,59] [,60] [,61] [,62] [,63] [,64]
[1,] 0.3604308 -0.1212335 -1.548437 1.137352 -0.2680097 -0.1019258 -1.276082
[2,] 0.3604308 -0.1212335 -1.548437 1.137352 -0.2680097 -0.1019258 -1.276082
[,65] [,66] [,67] [,68] [,69] [,70] [,71]
[1,] 0.4281747 -0.7794717 -1.695226 0.7899647 0.9250963 -1.720888 -0.5492195
[2,] 0.4281747 -0.7794717 -1.695226 0.7899647 0.9250963 -1.720888 -0.5492195
[,72] [,73] [,74] [,75] [,76] [,77] [,78]
[1,] -0.1972386 2.458695 0.9763437 0.743468 0.2884316 0.9801932 0.6499808
[2,] -0.1972386 2.458695 0.9763437 0.743468 0.2884316 0.9801932 0.6499808
[,79] [,80] [,81] [,82] [,83] [,84] [,85]
[1,] -0.6014151 0.8761922 -1.388928 0.7713354 -0.95127 1.814625 -0.1483858
[2,] -0.6014151 0.8761922 -1.388928 0.7713354 -0.95127 1.814625 -0.1483858
[,86] [,87] [,88] [,89] [,90] [,91] [,92]
[1,] -0.1206174 0.1468111 0.9694121 -0.571528 -0.2111314 -0.6191408 -0.410089
[2,] -0.1206174 0.1468111 0.9694121 -0.571528 -0.2111314 -0.6191408 -0.410089
[,93] [,94] [,95] [,96] [,97] [,98] [,99]
[1,] 0.4811027 -0.3596633 -1.637611 -1.494799 -1.0244 0.7746454 -0.7970661
[2,] 0.4811027 -0.3596633 -1.637611 -1.494799 -1.0244 0.7746454 -0.7970661
[,100]
[1,] -2.740274
[2,] -2.740274
>
>
> Max(tmp2)
[1] 3.638439
> Min(tmp2)
[1] -2.618627
> mean(tmp2)
[1] 0.0904014
> Sum(tmp2)
[1] 9.04014
> Var(tmp2)
[1] 1.285326
>
> rowMeans(tmp2)
[1] 1.664531680 0.450716310 0.501336479 -0.346010401 0.463792108
[6] -0.687874777 3.638439411 -1.472299116 1.238995748 1.683585015
[11] 0.382551212 1.660281012 0.174682169 -0.376268285 -0.561606432
[16] 0.372025106 -2.410290863 -0.815454393 -1.874862250 0.376000090
[21] 0.410997271 2.586061643 1.548501628 0.724197299 0.582189745
[26] 1.181143606 -1.590526814 -0.003439814 -1.412861155 0.368182349
[31] -0.486961380 0.443000126 2.434523542 1.104492248 -1.560373561
[36] -0.540412067 0.914296502 -0.655782184 -0.944204152 0.666313642
[41] -0.094462143 1.194131022 -0.243179734 1.461889629 0.433154369
[46] -0.629127638 1.562124749 0.051251672 -2.618627103 0.652413405
[51] -0.884846300 0.432068553 -1.351596879 0.363447519 -0.661531475
[56] -1.260954596 2.292450889 -0.381127397 -0.573920216 0.689082496
[61] 0.308418274 -1.006834921 0.598138193 1.751687178 -0.432240708
[66] 0.921341078 -1.026643205 0.166763199 0.751855844 -0.114868810
[71] 0.326935407 -0.293767485 -1.381674932 -2.142592170 0.040349562
[76] -0.190864301 1.531942890 1.588084732 0.178107718 -1.212913658
[81] 1.120102574 -1.360374907 1.582415196 -0.358110718 0.378682978
[86] -0.863861232 -0.628328437 0.891138682 0.074629330 0.209991716
[91] -1.663286078 -1.812845134 0.702799402 -0.317089428 0.475294767
[96] 0.908049486 -0.551527326 -0.304918244 0.205834347 -0.273930020
> rowSums(tmp2)
[1] 1.664531680 0.450716310 0.501336479 -0.346010401 0.463792108
[6] -0.687874777 3.638439411 -1.472299116 1.238995748 1.683585015
[11] 0.382551212 1.660281012 0.174682169 -0.376268285 -0.561606432
[16] 0.372025106 -2.410290863 -0.815454393 -1.874862250 0.376000090
[21] 0.410997271 2.586061643 1.548501628 0.724197299 0.582189745
[26] 1.181143606 -1.590526814 -0.003439814 -1.412861155 0.368182349
[31] -0.486961380 0.443000126 2.434523542 1.104492248 -1.560373561
[36] -0.540412067 0.914296502 -0.655782184 -0.944204152 0.666313642
[41] -0.094462143 1.194131022 -0.243179734 1.461889629 0.433154369
[46] -0.629127638 1.562124749 0.051251672 -2.618627103 0.652413405
[51] -0.884846300 0.432068553 -1.351596879 0.363447519 -0.661531475
[56] -1.260954596 2.292450889 -0.381127397 -0.573920216 0.689082496
[61] 0.308418274 -1.006834921 0.598138193 1.751687178 -0.432240708
[66] 0.921341078 -1.026643205 0.166763199 0.751855844 -0.114868810
[71] 0.326935407 -0.293767485 -1.381674932 -2.142592170 0.040349562
[76] -0.190864301 1.531942890 1.588084732 0.178107718 -1.212913658
[81] 1.120102574 -1.360374907 1.582415196 -0.358110718 0.378682978
[86] -0.863861232 -0.628328437 0.891138682 0.074629330 0.209991716
[91] -1.663286078 -1.812845134 0.702799402 -0.317089428 0.475294767
[96] 0.908049486 -0.551527326 -0.304918244 0.205834347 -0.273930020
> 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] 1.664531680 0.450716310 0.501336479 -0.346010401 0.463792108
[6] -0.687874777 3.638439411 -1.472299116 1.238995748 1.683585015
[11] 0.382551212 1.660281012 0.174682169 -0.376268285 -0.561606432
[16] 0.372025106 -2.410290863 -0.815454393 -1.874862250 0.376000090
[21] 0.410997271 2.586061643 1.548501628 0.724197299 0.582189745
[26] 1.181143606 -1.590526814 -0.003439814 -1.412861155 0.368182349
[31] -0.486961380 0.443000126 2.434523542 1.104492248 -1.560373561
[36] -0.540412067 0.914296502 -0.655782184 -0.944204152 0.666313642
[41] -0.094462143 1.194131022 -0.243179734 1.461889629 0.433154369
[46] -0.629127638 1.562124749 0.051251672 -2.618627103 0.652413405
[51] -0.884846300 0.432068553 -1.351596879 0.363447519 -0.661531475
[56] -1.260954596 2.292450889 -0.381127397 -0.573920216 0.689082496
[61] 0.308418274 -1.006834921 0.598138193 1.751687178 -0.432240708
[66] 0.921341078 -1.026643205 0.166763199 0.751855844 -0.114868810
[71] 0.326935407 -0.293767485 -1.381674932 -2.142592170 0.040349562
[76] -0.190864301 1.531942890 1.588084732 0.178107718 -1.212913658
[81] 1.120102574 -1.360374907 1.582415196 -0.358110718 0.378682978
[86] -0.863861232 -0.628328437 0.891138682 0.074629330 0.209991716
[91] -1.663286078 -1.812845134 0.702799402 -0.317089428 0.475294767
[96] 0.908049486 -0.551527326 -0.304918244 0.205834347 -0.273930020
> rowMin(tmp2)
[1] 1.664531680 0.450716310 0.501336479 -0.346010401 0.463792108
[6] -0.687874777 3.638439411 -1.472299116 1.238995748 1.683585015
[11] 0.382551212 1.660281012 0.174682169 -0.376268285 -0.561606432
[16] 0.372025106 -2.410290863 -0.815454393 -1.874862250 0.376000090
[21] 0.410997271 2.586061643 1.548501628 0.724197299 0.582189745
[26] 1.181143606 -1.590526814 -0.003439814 -1.412861155 0.368182349
[31] -0.486961380 0.443000126 2.434523542 1.104492248 -1.560373561
[36] -0.540412067 0.914296502 -0.655782184 -0.944204152 0.666313642
[41] -0.094462143 1.194131022 -0.243179734 1.461889629 0.433154369
[46] -0.629127638 1.562124749 0.051251672 -2.618627103 0.652413405
[51] -0.884846300 0.432068553 -1.351596879 0.363447519 -0.661531475
[56] -1.260954596 2.292450889 -0.381127397 -0.573920216 0.689082496
[61] 0.308418274 -1.006834921 0.598138193 1.751687178 -0.432240708
[66] 0.921341078 -1.026643205 0.166763199 0.751855844 -0.114868810
[71] 0.326935407 -0.293767485 -1.381674932 -2.142592170 0.040349562
[76] -0.190864301 1.531942890 1.588084732 0.178107718 -1.212913658
[81] 1.120102574 -1.360374907 1.582415196 -0.358110718 0.378682978
[86] -0.863861232 -0.628328437 0.891138682 0.074629330 0.209991716
[91] -1.663286078 -1.812845134 0.702799402 -0.317089428 0.475294767
[96] 0.908049486 -0.551527326 -0.304918244 0.205834347 -0.273930020
>
> colMeans(tmp2)
[1] 0.0904014
> colSums(tmp2)
[1] 9.04014
> colVars(tmp2)
[1] 1.285326
> colSd(tmp2)
[1] 1.133722
> colMax(tmp2)
[1] 3.638439
> colMin(tmp2)
[1] -2.618627
> colMedians(tmp2)
[1] 0.1763949
> colRanges(tmp2)
[,1]
[1,] -2.618627
[2,] 3.638439
>
> 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.53683040 0.05591159 0.77487331 -1.16769656 1.10392903 3.22941235
[7] 3.48802389 -1.96901977 0.60535022 2.46510062
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3774002
[2,] -1.0546065
[3,] -0.1396979
[4,] 0.8966644
[5,] 1.6039057
>
> rowApply(tmp,sum)
[1] 5.916684 -7.118807 -3.638423 2.226832 4.402967 1.977610 3.239856
[8] -0.269069 2.768710 -1.457308
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 7 8 1 1 8 1 4 10 9 3
[2,] 2 4 9 4 10 6 5 1 2 5
[3,] 3 7 5 9 1 7 2 7 6 10
[4,] 1 5 2 8 7 4 7 9 4 1
[5,] 9 9 3 6 5 8 10 2 1 6
[6,] 4 6 4 10 6 10 6 6 7 4
[7,] 8 10 6 5 3 9 3 8 8 7
[8,] 5 1 8 2 4 5 9 3 5 2
[9,] 10 2 7 7 2 3 1 4 10 9
[10,] 6 3 10 3 9 2 8 5 3 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.20986174 -1.83712403 1.61474748 2.38650832 -4.19693158 -0.64007706
[7] -3.18230120 1.93456725 3.27558224 0.99918683 1.44270424 2.12301101
[13] -1.35520635 1.38827137 -1.91949122 0.55275703 -1.68198906 -0.02566709
[19] 1.56822154 -2.34449763
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.961004
[2,] 0.241329
[3,] 0.571959
[4,] 0.786318
[5,] 1.571260
>
> rowApply(tmp,sum)
[1] 0.9471729 3.9693495 -3.4681391 2.9023385 -3.0385880
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 16 18 15 2 15
[2,] 6 10 12 3 12
[3,] 3 17 14 15 16
[4,] 20 19 3 9 11
[5,] 14 4 4 1 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.786318 -0.62828238 -1.16389567 2.00386370 0.4244066 -1.71567058
[2,] 1.571260 -0.06254938 1.56362522 1.59715587 -0.9134171 -0.33239912
[3,] 0.241329 -0.14740158 0.02892702 -1.14070676 -0.7400498 -0.51087704
[4,] -1.961004 -0.88342976 0.58314379 0.04724727 -2.2198744 1.97218180
[5,] 0.571959 -0.11546093 0.60294711 -0.12105176 -0.7479969 -0.05331212
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.04521563 -0.8352633 0.4112291 1.3875681 -0.8007967 -0.11320763
[2,] -1.19245620 0.9554059 1.6268922 0.3847080 0.9926689 0.02231839
[3,] -0.32110538 -0.4002244 -0.1798589 0.4070516 -0.6045118 1.17492328
[4,] -0.67595545 0.5174178 0.5724401 0.1185670 1.2242850 2.22891845
[5,] -0.94756854 1.6972313 0.8448797 -1.2987079 0.6310589 -1.18994148
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.06492013 -0.1043984 0.06987794 0.96893089 -1.44002900 -0.03465604
[2,] -1.01339302 0.8328947 0.25751014 -0.09212547 -0.19253032 -0.92772372
[3,] -0.73075703 0.4024974 -1.42665037 -0.17076333 0.61026285 2.02803427
[4,] -0.05945255 0.9357598 -0.74506718 0.21601153 -0.02392936 0.25313264
[5,] -0.61652390 -0.6784822 -0.07516175 -0.36929660 -0.63576323 -1.34445425
[,19] [,20]
[1,] 0.6818566 0.02961731
[2,] -0.5482202 -0.56027505
[3,] -0.1235529 -1.86470541
[4,] 1.6829403 -0.88099425
[5,] -0.1248023 0.93185978
>
>
> 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 : 654 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 : 567 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.3127258 -0.9241882 -0.2321965 -2.219867 -1.340944 -0.7914164 -0.186004
col8 col9 col10 col11 col12 col13 col14
row1 0.5554908 -0.590665 0.1702861 -0.05958612 0.1781202 1.447855 2.272099
col15 col16 col17 col18 col19 col20
row1 2.131696 0.5803059 -1.984138 -0.3925458 -0.1467382 0.5140009
> tmp[,"col10"]
col10
row1 0.1702861
row2 -1.0169034
row3 0.4881287
row4 -0.9693357
row5 -0.6015227
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.3127258 -0.9241882 -0.2321965 -2.2198671 -1.3409444 -0.79141643
row5 1.1481814 0.6208255 -1.2274022 0.7388716 0.4545065 0.04452821
col7 col8 col9 col10 col11 col12 col13
row1 -0.1860040 0.5554908 -0.5906650 0.1702861 -0.05958612 0.1781202 1.447855
row5 0.6423832 0.4774747 0.5513914 -0.6015227 0.29965080 1.7261283 1.345168
col14 col15 col16 col17 col18 col19
row1 2.2720991 2.1316957 0.5803059 -1.9841377 -0.3925458 -0.1467382
row5 0.5360083 -0.4579901 -1.5248353 -0.4429412 -0.1810456 -0.4560020
col20
row1 0.5140009
row5 -0.9942356
> tmp[,c("col6","col20")]
col6 col20
row1 -0.79141643 0.5140009
row2 -1.97732029 -1.3980882
row3 0.04045782 -0.3451059
row4 1.28926379 0.2159228
row5 0.04452821 -0.9942356
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.79141643 0.5140009
row5 0.04452821 -0.9942356
>
>
>
>
> 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 49.01415 50.67666 49.67557 50.52592 52.47122 104.8771 48.6088 51.06193
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.13694 49.14348 49.18944 49.22997 52.10833 50.23588 51.7556 48.62333
col17 col18 col19 col20
row1 50.66606 48.21932 51.09602 104.3818
> tmp[,"col10"]
col10
row1 49.14348
row2 30.22679
row3 30.45462
row4 28.79155
row5 51.25179
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.01415 50.67666 49.67557 50.52592 52.47122 104.8771 48.60880 51.06193
row5 47.41710 51.78787 48.97318 50.52307 49.75125 105.2855 49.27582 49.13158
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.13694 49.14348 49.18944 49.22997 52.10833 50.23588 51.75560 48.62333
row5 49.97695 51.25179 50.76338 48.46459 49.15888 48.29168 49.96777 49.69418
col17 col18 col19 col20
row1 50.66606 48.21932 51.09602 104.3818
row5 49.80846 50.31547 51.52330 104.0501
> tmp[,c("col6","col20")]
col6 col20
row1 104.87715 104.38183
row2 74.19466 73.77151
row3 75.22490 73.59813
row4 73.98324 76.77957
row5 105.28550 104.05010
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.8771 104.3818
row5 105.2855 104.0501
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.8771 104.3818
row5 105.2855 104.0501
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.3026508
[2,] 2.6336826
[3,] -2.0372662
[4,] 0.7396703
[5,] 0.3081269
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.3332704 -1.3780280
[2,] -0.2800741 1.2847563
[3,] 0.3495404 -0.2352510
[4,] -0.6318088 0.6352491
[5,] -0.4983469 -1.6212259
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.060606566 0.7622353
[2,] -0.793445011 0.4774584
[3,] -0.624900237 0.2035122
[4,] 1.092349506 -0.6358556
[5,] -0.001954595 2.0896619
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.06060657
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.06060657
[2,] -0.79344501
>
>
>
> 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.6571359 0.3889590 0.7629997 -0.362693663 -0.509761 -0.4537181 -0.6205198
row1 0.2038002 0.2178012 0.7118690 0.002637523 0.817271 0.2517089 -1.4706581
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.8894458 1.186795 -0.292400 -0.09540867 0.4545029 0.1363084 -0.7927837
row1 -0.5289017 -2.015277 1.250536 0.59311520 -0.2153192 0.2792862 -0.7309464
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.001213816 -0.6665265 0.6951129 -1.392085 0.6872239 1.2384242
row1 1.963882616 -0.0365511 -0.1425103 0.350849 2.2610090 0.1877626
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.02515582 0.05037133 -0.4724942 0.9484507 0.6206537 -1.321618 0.4138576
[,8] [,9] [,10]
row2 0.7542129 -1.041143 0.3375493
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.161962 -2.746482 1.900375 0.6923628 0.4366787 0.7994191 0.3865633
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.6919767 -0.7539662 -0.1695356 -1.318832 -1.366012 -0.2668565 -1.189314
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3720593 0.8241647 -0.1185139 1.680355 -0.2856342 -1.181705
>
>
> 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: 0x600002164240>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147637e92ac9b"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147634f823508"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147636d67c8ff"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476338bd1576"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147635cc1314"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476318f88905"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476364ebb411"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147632e7afbda"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14763c2cbd0d"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147634d2fa6b9"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14763736ae345"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM147636e6f0235"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476339fa1e37"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476353d5ca9d"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1476378e9346a"
>
>
> ### 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: 0x600002150480>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002150480>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600002150480>
> rowMedians(tmp)
[1] -0.138516078 -0.006621021 0.318837676 -0.322113051 -0.061897968
[6] 0.071329786 -0.145528796 0.558525143 0.520024587 -0.373585091
[11] 0.163157488 -0.237098259 0.627557753 0.644595970 -0.322285886
[16] -0.189250483 -0.173361880 -0.064005685 -0.109114428 0.130970082
[21] 0.516986756 0.196694883 0.116998637 0.106147457 0.221473281
[26] 0.581708072 -0.099339815 -0.353646468 0.519960674 -0.066934861
[31] 0.329870534 0.340952396 -0.588892434 -0.274426983 0.045962439
[36] 0.006068559 -0.070949243 0.277239385 -0.006106059 0.046073922
[41] -0.251287624 0.379286271 0.207729582 -0.632149390 -0.126979906
[46] -0.082305820 -0.210324544 0.256700649 -0.280525430 0.088949896
[51] 0.450318949 0.239518462 0.222161315 -0.366661606 0.111464517
[56] -0.605037869 -0.016212346 -0.296572635 -0.084477971 0.322422612
[61] -0.092616749 0.402044045 -0.275908014 0.111869819 0.095669643
[66] -0.566529750 -0.415677874 -0.151348421 0.089945481 -0.679273862
[71] 0.954287707 0.141384519 0.565491982 -0.155668085 -0.292888748
[76] 0.352145153 0.093541624 0.112871624 -0.401996648 0.420708888
[81] 0.175945623 0.142231485 0.135719681 0.448696035 0.330588533
[86] 0.305758486 -0.114152833 0.273776276 0.365252726 -0.439500094
[91] -0.361266530 -0.037079398 -0.605367210 0.094501396 0.016103102
[96] -0.474055605 -0.181628675 0.167386332 0.247080981 0.363674385
[101] 0.573531327 0.175991272 0.232830977 -0.245336452 0.044553914
[106] 0.807373585 -0.021570390 0.331345609 0.212893318 0.152535756
[111] 0.299763189 0.176810130 -0.168991746 -0.048370269 0.194546540
[116] 0.035424262 0.551876287 0.413543014 -0.063820688 -0.107975761
[121] -0.271262420 -0.112131312 0.179085123 -0.001722524 -0.552706623
[126] -0.418297883 -0.014960080 0.208811378 -0.386548412 0.333157206
[131] 0.089447176 0.077558656 -0.039201456 0.281426382 -0.009537344
[136] 0.222120351 0.282355760 0.049087316 -0.150586999 -0.286164352
[141] -0.136997794 -0.679609601 0.554676528 0.080205943 0.071174729
[146] 0.095723641 0.025749365 -0.229457018 0.149121759 -0.346493536
[151] -0.302546057 0.179367471 0.193535598 -0.240519147 -0.053768724
[156] -0.466578618 -0.281230099 -0.116099242 -0.715556300 0.618223414
[161] 0.473722707 0.303617172 0.247611610 0.039691539 -0.379330924
[166] 0.172890858 -0.318826184 0.244458090 0.152831182 -0.175804868
[171] -0.204744344 -0.616100373 0.791198115 -0.216302868 -0.144284967
[176] 0.281159033 -0.126393225 0.310964964 0.322596780 0.629194846
[181] -0.308122870 0.489710076 -0.355143082 0.596297001 0.136840874
[186] -0.175688874 -0.112902916 -0.116103699 0.151993753 0.598040242
[191] 0.590437249 -0.265048040 -0.436156103 0.059125297 0.289801353
[196] -0.145804840 0.392632979 -0.259168447 0.409575179 -0.018481486
[201] -0.091570209 -0.362940021 -0.031527561 0.435815001 -0.441422478
[206] -0.080286075 0.385887447 0.404005526 0.346261799 0.432758187
[211] -0.629150321 0.112587188 0.560374608 0.145491645 -0.250334382
[216] -0.014338602 -0.153205499 0.003479040 0.061096389 0.421047076
[221] -0.347040761 -0.176472051 0.002040598 0.677385677 0.122901834
[226] -0.145607687 -0.007749814 0.146845062 -0.256723199 0.126186558
>
> proc.time()
user system elapsed
0.734 3.304 4.587
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-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: 0x600000724000>
> .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: 0x600000724000>
> .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: 0x600000724000>
> .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: 0x600000724000>
> 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: 0x60000070c060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000070c060>
> .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: 0x60000070c060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000070c060>
> .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: 0x60000070c060>
> 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: 0x600000730000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000730000>
> .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: 0x600000730000>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000730000>
> .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: 0x600000730000>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600000730000>
> .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: 0x600000730000>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600000730000>
> .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: 0x600000730000>
> 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: 0x600000734000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000734000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000734000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000734000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14a86407fa025" "BufferedMatrixFile14a867aeafe37"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14a86407fa025" "BufferedMatrixFile14a867aeafe37"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000748000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000748000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000748000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000748000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000748000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000748000>
> .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: 0x600000710480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000710480>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000710480>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000710480>
> 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: 0x60000070c120>
> .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: 0x60000070c120>
> rm(P)
>
> proc.time()
user system elapsed
0.136 0.063 0.198
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-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.148 0.044 0.183