| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-07 12:00 -0500 (Fri, 07 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4902 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4638 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.74.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.74.0.tar.gz |
| StartedAt: 2025-11-06 18:47:18 -0500 (Thu, 06 Nov 2025) |
| EndedAt: 2025-11-06 18:47:34 -0500 (Thu, 06 Nov 2025) |
| EllapsedTime: 16.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.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* 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 Ventura 13.7.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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.22-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 ... NOTE
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, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.5-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 version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 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.111 0.040 0.147
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 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.22-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 480828 25.7 1056614 56.5 NA 634360 33.9
Vcells 891019 6.8 8388608 64.0 196608 2109493 16.1
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Nov 6 18:47:27 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 6 18:47:27 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x600001bd48a0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Nov 6 18:47:28 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 6 18:47:28 2025"
>
> ColMode(tmp2)
<pointer: 0x600001bd48a0>
>
>
>
> ### 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,] 99.5151732 -1.4368338 -1.06844651 -0.4353788
[2,] 1.0413020 0.1701687 0.46078650 -1.6985959
[3,] -0.6918085 0.2004154 0.00359057 0.8377006
[4,] -0.9646774 0.6567192 -0.13761227 0.6969410
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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,] 99.5151732 1.4368338 1.06844651 0.4353788
[2,] 1.0413020 0.1701687 0.46078650 1.6985959
[3,] 0.6918085 0.2004154 0.00359057 0.8377006
[4,] 0.9646774 0.6567192 0.13761227 0.6969410
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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,] 9.9757292 1.1986800 1.03365686 0.6598324
[2,] 1.0204421 0.4125151 0.67881257 1.3033019
[3,] 0.8317502 0.4476778 0.05992136 0.9152598
[4,] 0.9821799 0.8103821 0.37096128 0.8348299
>
> 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.22-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,] 224.27247 38.42363 36.40502 32.03370
[2,] 36.24572 29.29532 32.24891 39.73162
[3,] 34.00931 29.67719 25.60280 34.99030
[4,] 35.78648 33.76054 28.84723 34.04524
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001bd85a0>
> exp(tmp5)
<pointer: 0x600001bd85a0>
> log(tmp5,2)
<pointer: 0x600001bd85a0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7938
> Min(tmp5)
[1] 53.28888
> mean(tmp5)
[1] 73.13931
> Sum(tmp5)
[1] 14627.86
> Var(tmp5)
[1] 856.0025
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.65698 71.10223 69.24304 70.28735 73.51813 71.29176 72.31423 73.55974
[9] 70.27679 68.14284
> rowSums(tmp5)
[1] 1833.140 1422.045 1384.861 1405.747 1470.363 1425.835 1446.285 1471.195
[9] 1405.536 1362.857
> rowVars(tmp5)
[1] 7877.74028 98.38595 56.05211 60.47438 52.85631 98.13178
[7] 48.21081 93.35129 89.68618 61.19855
> rowSd(tmp5)
[1] 88.756635 9.918969 7.486796 7.776528 7.270235 9.906149 6.943401
[8] 9.661847 9.470279 7.822950
> rowMax(tmp5)
[1] 466.79375 94.11291 82.53443 87.38711 86.24254 85.81626 81.82992
[8] 87.65294 86.34123 88.37358
> rowMin(tmp5)
[1] 58.38429 56.79624 53.28888 57.66553 59.74899 54.29166 58.45566 56.68455
[9] 54.55648 55.84578
>
> colMeans(tmp5)
[1] 112.04586 69.74336 68.21102 72.39428 71.86603 69.56846 72.40145
[8] 72.18433 73.24681 68.86509 68.64167 72.40704 75.39210 66.83467
[15] 74.11056 74.77149 72.29722 69.88752 67.79396 70.12326
> colSums(tmp5)
[1] 1120.4586 697.4336 682.1102 723.9428 718.6603 695.6846 724.0145
[8] 721.8433 732.4681 688.6509 686.4167 724.0704 753.9210 668.3467
[15] 741.1056 747.7149 722.9722 698.8752 677.9396 701.2326
> colVars(tmp5)
[1] 15556.52938 69.41519 119.31420 34.67691 94.66425 63.49095
[7] 133.17517 109.14841 58.76520 82.78216 39.44641 68.85540
[13] 128.57592 48.67158 100.97892 56.75863 71.66617 72.07922
[19] 77.39953 49.26942
> colSd(tmp5)
[1] 124.725817 8.331578 10.923104 5.888710 9.729556 7.968121
[7] 11.540155 10.447411 7.665846 9.098470 6.280638 8.297915
[13] 11.339132 6.976502 10.048827 7.533832 8.465588 8.489948
[19] 8.797700 7.019218
> colMax(tmp5)
[1] 466.79375 80.84109 85.06921 82.69615 88.29282 83.52276 94.11291
[8] 91.36925 86.34123 79.93887 83.40826 86.24254 88.37358 79.77903
[15] 87.65294 87.38711 83.10968 81.03996 83.66592 80.77049
> colMin(tmp5)
[1] 62.62092 55.84578 53.28888 64.12797 59.03031 61.23549 56.68455 57.27780
[9] 61.31751 54.29166 63.04745 58.38429 56.28204 57.47959 59.67626 64.32441
[17] 54.53214 57.97492 55.14475 56.79624
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.65698 NA 69.24304 70.28735 73.51813 71.29176 72.31423 73.55974
[9] 70.27679 68.14284
> rowSums(tmp5)
[1] 1833.140 NA 1384.861 1405.747 1470.363 1425.835 1446.285 1471.195
[9] 1405.536 1362.857
> rowVars(tmp5)
[1] 7877.74028 103.52879 56.05211 60.47438 52.85631 98.13178
[7] 48.21081 93.35129 89.68618 61.19855
> rowSd(tmp5)
[1] 88.756635 10.174910 7.486796 7.776528 7.270235 9.906149 6.943401
[8] 9.661847 9.470279 7.822950
> rowMax(tmp5)
[1] 466.79375 NA 82.53443 87.38711 86.24254 85.81626 81.82992
[8] 87.65294 86.34123 88.37358
> rowMin(tmp5)
[1] 58.38429 NA 53.28888 57.66553 59.74899 54.29166 58.45566 56.68455
[9] 54.55648 55.84578
>
> colMeans(tmp5)
[1] 112.04586 69.74336 68.21102 72.39428 71.86603 69.56846 72.40145
[8] 72.18433 NA 68.86509 68.64167 72.40704 75.39210 66.83467
[15] 74.11056 74.77149 72.29722 69.88752 67.79396 70.12326
> colSums(tmp5)
[1] 1120.4586 697.4336 682.1102 723.9428 718.6603 695.6846 724.0145
[8] 721.8433 NA 688.6509 686.4167 724.0704 753.9210 668.3467
[15] 741.1056 747.7149 722.9722 698.8752 677.9396 701.2326
> colVars(tmp5)
[1] 15556.52938 69.41519 119.31420 34.67691 94.66425 63.49095
[7] 133.17517 109.14841 NA 82.78216 39.44641 68.85540
[13] 128.57592 48.67158 100.97892 56.75863 71.66617 72.07922
[19] 77.39953 49.26942
> colSd(tmp5)
[1] 124.725817 8.331578 10.923104 5.888710 9.729556 7.968121
[7] 11.540155 10.447411 NA 9.098470 6.280638 8.297915
[13] 11.339132 6.976502 10.048827 7.533832 8.465588 8.489948
[19] 8.797700 7.019218
> colMax(tmp5)
[1] 466.79375 80.84109 85.06921 82.69615 88.29282 83.52276 94.11291
[8] 91.36925 NA 79.93887 83.40826 86.24254 88.37358 79.77903
[15] 87.65294 87.38711 83.10968 81.03996 83.66592 80.77049
> colMin(tmp5)
[1] 62.62092 55.84578 53.28888 64.12797 59.03031 61.23549 56.68455 57.27780
[9] NA 54.29166 63.04745 58.38429 56.28204 57.47959 59.67626 64.32441
[17] 54.53214 57.97492 55.14475 56.79624
>
> Max(tmp5,na.rm=TRUE)
[1] 466.7938
> Min(tmp5,na.rm=TRUE)
[1] 53.28888
> mean(tmp5,na.rm=TRUE)
[1] 73.16136
> Sum(tmp5,na.rm=TRUE)
[1] 14559.11
> Var(tmp5,na.rm=TRUE)
[1] 860.228
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.65698 71.22594 69.24304 70.28735 73.51813 71.29176 72.31423 73.55974
[9] 70.27679 68.14284
> rowSums(tmp5,na.rm=TRUE)
[1] 1833.140 1353.293 1384.861 1405.747 1470.363 1425.835 1446.285 1471.195
[9] 1405.536 1362.857
> rowVars(tmp5,na.rm=TRUE)
[1] 7877.74028 103.52879 56.05211 60.47438 52.85631 98.13178
[7] 48.21081 93.35129 89.68618 61.19855
> rowSd(tmp5,na.rm=TRUE)
[1] 88.756635 10.174910 7.486796 7.776528 7.270235 9.906149 6.943401
[8] 9.661847 9.470279 7.822950
> rowMax(tmp5,na.rm=TRUE)
[1] 466.79375 94.11291 82.53443 87.38711 86.24254 85.81626 81.82992
[8] 87.65294 86.34123 88.37358
> rowMin(tmp5,na.rm=TRUE)
[1] 58.38429 56.79624 53.28888 57.66553 59.74899 54.29166 58.45566 56.68455
[9] 54.55648 55.84578
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.04586 69.74336 68.21102 72.39428 71.86603 69.56846 72.40145
[8] 72.18433 73.74624 68.86509 68.64167 72.40704 75.39210 66.83467
[15] 74.11056 74.77149 72.29722 69.88752 67.79396 70.12326
> colSums(tmp5,na.rm=TRUE)
[1] 1120.4586 697.4336 682.1102 723.9428 718.6603 695.6846 724.0145
[8] 721.8433 663.7162 688.6509 686.4167 724.0704 753.9210 668.3467
[15] 741.1056 747.7149 722.9722 698.8752 677.9396 701.2326
> colVars(tmp5,na.rm=TRUE)
[1] 15556.52938 69.41519 119.31420 34.67691 94.66425 63.49095
[7] 133.17517 109.14841 63.30470 82.78216 39.44641 68.85540
[13] 128.57592 48.67158 100.97892 56.75863 71.66617 72.07922
[19] 77.39953 49.26942
> colSd(tmp5,na.rm=TRUE)
[1] 124.725817 8.331578 10.923104 5.888710 9.729556 7.968121
[7] 11.540155 10.447411 7.956425 9.098470 6.280638 8.297915
[13] 11.339132 6.976502 10.048827 7.533832 8.465588 8.489948
[19] 8.797700 7.019218
> colMax(tmp5,na.rm=TRUE)
[1] 466.79375 80.84109 85.06921 82.69615 88.29282 83.52276 94.11291
[8] 91.36925 86.34123 79.93887 83.40826 86.24254 88.37358 79.77903
[15] 87.65294 87.38711 83.10968 81.03996 83.66592 80.77049
> colMin(tmp5,na.rm=TRUE)
[1] 62.62092 55.84578 53.28888 64.12797 59.03031 61.23549 56.68455 57.27780
[9] 61.31751 54.29166 63.04745 58.38429 56.28204 57.47959 59.67626 64.32441
[17] 54.53214 57.97492 55.14475 56.79624
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.65698 NaN 69.24304 70.28735 73.51813 71.29176 72.31423 73.55974
[9] 70.27679 68.14284
> rowSums(tmp5,na.rm=TRUE)
[1] 1833.140 0.000 1384.861 1405.747 1470.363 1425.835 1446.285 1471.195
[9] 1405.536 1362.857
> rowVars(tmp5,na.rm=TRUE)
[1] 7877.74028 NA 56.05211 60.47438 52.85631 98.13178
[7] 48.21081 93.35129 89.68618 61.19855
> rowSd(tmp5,na.rm=TRUE)
[1] 88.756635 NA 7.486796 7.776528 7.270235 9.906149 6.943401
[8] 9.661847 9.470279 7.822950
> rowMax(tmp5,na.rm=TRUE)
[1] 466.79375 NA 82.53443 87.38711 86.24254 85.81626 81.82992
[8] 87.65294 86.34123 88.37358
> rowMin(tmp5,na.rm=TRUE)
[1] 58.38429 NA 53.28888 57.66553 59.74899 54.29166 58.45566 56.68455
[9] 54.55648 55.84578
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.11310 70.71770 68.33204 71.24963 70.04083 69.90072 69.98907
[8] 73.63270 NaN 67.63467 68.44280 71.96736 76.74593 66.65791
[15] 73.79953 75.93228 71.89953 70.60396 68.30297 71.60404
> colSums(tmp5,na.rm=TRUE)
[1] 1045.0179 636.4593 614.9883 641.2467 630.3674 629.1065 629.9016
[8] 662.6943 0.0000 608.7121 615.9852 647.7062 690.7134 599.9211
[15] 664.1958 683.3905 647.0958 635.4357 614.7268 644.4363
> colVars(tmp5,na.rm=TRUE)
[1] 17314.99329 67.41219 134.06372 24.27144 69.01957 70.18536
[7] 84.35160 99.19183 NA 76.09818 43.93229 75.28749
[13] 124.02827 54.40401 112.51296 48.69491 78.84522 75.31456
[19] 84.15959 30.76012
> colSd(tmp5,na.rm=TRUE)
[1] 131.586448 8.210493 11.578589 4.926606 8.307802 8.377670
[7] 9.184313 9.959509 NA 8.723427 6.628144 8.676836
[13] 11.136798 7.375907 10.607213 6.978174 8.879483 8.678396
[19] 9.173854 5.546180
> colMax(tmp5,na.rm=TRUE)
[1] 466.79375 80.84109 85.06921 79.72099 79.40529 83.52276 81.82992
[8] 91.36925 -Inf 79.17780 83.40826 86.24254 88.37358 79.77903
[15] 87.65294 87.38711 83.10968 81.03996 83.66592 80.77049
> colMin(tmp5,na.rm=TRUE)
[1] 62.62092 55.84578 53.28888 64.12797 59.03031 61.23549 56.68455 57.27780
[9] Inf 54.29166 63.04745 58.38429 56.28204 57.47959 59.67626 68.91438
[17] 54.53214 57.97492 55.14475 64.64254
>
>
>
>
> 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] 280.55216 295.62956 342.69150 184.17276 181.12080 191.63271 258.90569
[8] 75.40344 258.63204 249.44917
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 280.55216 295.62956 342.69150 184.17276 181.12080 191.63271 258.90569
[8] 75.40344 258.63204 249.44917
>
>
>
> 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.705303e-13 -5.684342e-14 -2.842171e-14 2.557954e-13 0.000000e+00
[6] 2.842171e-14 -1.705303e-13 2.842171e-14 2.273737e-13 -5.684342e-14
[11] 0.000000e+00 1.705303e-13 1.421085e-13 -5.684342e-14 -1.705303e-13
[16] -1.705303e-13 1.705303e-13 0.000000e+00 -8.526513e-14 1.421085e-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)
+ }
9 8
9 5
10 3
3 7
3 2
10 2
10 12
5 6
1 18
5 11
8 8
8 8
7 19
6 17
4 8
8 6
5 9
10 7
5 14
8 16
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.268877
> Min(tmp)
[1] -3.716979
> mean(tmp)
[1] -0.07252912
> Sum(tmp)
[1] -7.252912
> Var(tmp)
[1] 1.159435
>
> rowMeans(tmp)
[1] -0.07252912
> rowSums(tmp)
[1] -7.252912
> rowVars(tmp)
[1] 1.159435
> rowSd(tmp)
[1] 1.076771
> rowMax(tmp)
[1] 2.268877
> rowMin(tmp)
[1] -3.716979
>
> colMeans(tmp)
[1] 0.691420583 0.498411244 -0.189262650 0.416950928 -1.923083549
[6] 1.032620693 -0.253259269 0.358585460 0.239281476 -0.463453744
[11] 1.586277862 1.205729160 0.580123447 2.268877402 -0.484824875
[16] -0.106966732 1.037583537 0.268788376 -0.327640428 -1.294483299
[21] -0.544710411 0.655813199 1.037281072 -1.095086659 0.977913617
[26] -0.342112656 -0.670413052 1.460943521 -0.327289944 1.007455627
[31] 0.709156906 2.056097430 -1.347124001 -0.015334259 -2.095608422
[36] -0.457850121 -0.831700002 -0.322790129 -0.389426679 -0.799142328
[41] 0.522504900 0.111770261 -1.565450745 -3.716979075 1.247353017
[46] -1.143164012 -2.377068644 0.682267898 -0.312437876 -0.105484761
[51] -0.605077864 -0.184380733 -0.900279758 -0.006787933 0.384679863
[56] -0.400101718 1.267350099 -1.060708490 0.571575285 -0.827715988
[61] -0.825914706 -0.150589348 -1.978188205 -1.650241223 -1.440982080
[66] -1.379882951 0.507764649 0.137778541 -1.321938181 -0.007442038
[71] 0.439810384 -0.616763088 -0.523202989 -0.297094658 0.400083023
[76] 0.695420346 1.836241456 -1.710645954 -0.710110575 -0.814279700
[81] 1.124530224 1.012374113 -0.425351951 0.833348045 -0.629251841
[86] -0.449619672 -1.147550943 1.952013591 -0.475212372 0.152135693
[91] 1.002014426 0.260859195 -0.638781014 1.608471514 2.174754449
[96] -0.798041830 0.467136891 0.952479747 -1.326073627 1.117418597
> colSums(tmp)
[1] 0.691420583 0.498411244 -0.189262650 0.416950928 -1.923083549
[6] 1.032620693 -0.253259269 0.358585460 0.239281476 -0.463453744
[11] 1.586277862 1.205729160 0.580123447 2.268877402 -0.484824875
[16] -0.106966732 1.037583537 0.268788376 -0.327640428 -1.294483299
[21] -0.544710411 0.655813199 1.037281072 -1.095086659 0.977913617
[26] -0.342112656 -0.670413052 1.460943521 -0.327289944 1.007455627
[31] 0.709156906 2.056097430 -1.347124001 -0.015334259 -2.095608422
[36] -0.457850121 -0.831700002 -0.322790129 -0.389426679 -0.799142328
[41] 0.522504900 0.111770261 -1.565450745 -3.716979075 1.247353017
[46] -1.143164012 -2.377068644 0.682267898 -0.312437876 -0.105484761
[51] -0.605077864 -0.184380733 -0.900279758 -0.006787933 0.384679863
[56] -0.400101718 1.267350099 -1.060708490 0.571575285 -0.827715988
[61] -0.825914706 -0.150589348 -1.978188205 -1.650241223 -1.440982080
[66] -1.379882951 0.507764649 0.137778541 -1.321938181 -0.007442038
[71] 0.439810384 -0.616763088 -0.523202989 -0.297094658 0.400083023
[76] 0.695420346 1.836241456 -1.710645954 -0.710110575 -0.814279700
[81] 1.124530224 1.012374113 -0.425351951 0.833348045 -0.629251841
[86] -0.449619672 -1.147550943 1.952013591 -0.475212372 0.152135693
[91] 1.002014426 0.260859195 -0.638781014 1.608471514 2.174754449
[96] -0.798041830 0.467136891 0.952479747 -1.326073627 1.117418597
> 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.691420583 0.498411244 -0.189262650 0.416950928 -1.923083549
[6] 1.032620693 -0.253259269 0.358585460 0.239281476 -0.463453744
[11] 1.586277862 1.205729160 0.580123447 2.268877402 -0.484824875
[16] -0.106966732 1.037583537 0.268788376 -0.327640428 -1.294483299
[21] -0.544710411 0.655813199 1.037281072 -1.095086659 0.977913617
[26] -0.342112656 -0.670413052 1.460943521 -0.327289944 1.007455627
[31] 0.709156906 2.056097430 -1.347124001 -0.015334259 -2.095608422
[36] -0.457850121 -0.831700002 -0.322790129 -0.389426679 -0.799142328
[41] 0.522504900 0.111770261 -1.565450745 -3.716979075 1.247353017
[46] -1.143164012 -2.377068644 0.682267898 -0.312437876 -0.105484761
[51] -0.605077864 -0.184380733 -0.900279758 -0.006787933 0.384679863
[56] -0.400101718 1.267350099 -1.060708490 0.571575285 -0.827715988
[61] -0.825914706 -0.150589348 -1.978188205 -1.650241223 -1.440982080
[66] -1.379882951 0.507764649 0.137778541 -1.321938181 -0.007442038
[71] 0.439810384 -0.616763088 -0.523202989 -0.297094658 0.400083023
[76] 0.695420346 1.836241456 -1.710645954 -0.710110575 -0.814279700
[81] 1.124530224 1.012374113 -0.425351951 0.833348045 -0.629251841
[86] -0.449619672 -1.147550943 1.952013591 -0.475212372 0.152135693
[91] 1.002014426 0.260859195 -0.638781014 1.608471514 2.174754449
[96] -0.798041830 0.467136891 0.952479747 -1.326073627 1.117418597
> colMin(tmp)
[1] 0.691420583 0.498411244 -0.189262650 0.416950928 -1.923083549
[6] 1.032620693 -0.253259269 0.358585460 0.239281476 -0.463453744
[11] 1.586277862 1.205729160 0.580123447 2.268877402 -0.484824875
[16] -0.106966732 1.037583537 0.268788376 -0.327640428 -1.294483299
[21] -0.544710411 0.655813199 1.037281072 -1.095086659 0.977913617
[26] -0.342112656 -0.670413052 1.460943521 -0.327289944 1.007455627
[31] 0.709156906 2.056097430 -1.347124001 -0.015334259 -2.095608422
[36] -0.457850121 -0.831700002 -0.322790129 -0.389426679 -0.799142328
[41] 0.522504900 0.111770261 -1.565450745 -3.716979075 1.247353017
[46] -1.143164012 -2.377068644 0.682267898 -0.312437876 -0.105484761
[51] -0.605077864 -0.184380733 -0.900279758 -0.006787933 0.384679863
[56] -0.400101718 1.267350099 -1.060708490 0.571575285 -0.827715988
[61] -0.825914706 -0.150589348 -1.978188205 -1.650241223 -1.440982080
[66] -1.379882951 0.507764649 0.137778541 -1.321938181 -0.007442038
[71] 0.439810384 -0.616763088 -0.523202989 -0.297094658 0.400083023
[76] 0.695420346 1.836241456 -1.710645954 -0.710110575 -0.814279700
[81] 1.124530224 1.012374113 -0.425351951 0.833348045 -0.629251841
[86] -0.449619672 -1.147550943 1.952013591 -0.475212372 0.152135693
[91] 1.002014426 0.260859195 -0.638781014 1.608471514 2.174754449
[96] -0.798041830 0.467136891 0.952479747 -1.326073627 1.117418597
> colMedians(tmp)
[1] 0.691420583 0.498411244 -0.189262650 0.416950928 -1.923083549
[6] 1.032620693 -0.253259269 0.358585460 0.239281476 -0.463453744
[11] 1.586277862 1.205729160 0.580123447 2.268877402 -0.484824875
[16] -0.106966732 1.037583537 0.268788376 -0.327640428 -1.294483299
[21] -0.544710411 0.655813199 1.037281072 -1.095086659 0.977913617
[26] -0.342112656 -0.670413052 1.460943521 -0.327289944 1.007455627
[31] 0.709156906 2.056097430 -1.347124001 -0.015334259 -2.095608422
[36] -0.457850121 -0.831700002 -0.322790129 -0.389426679 -0.799142328
[41] 0.522504900 0.111770261 -1.565450745 -3.716979075 1.247353017
[46] -1.143164012 -2.377068644 0.682267898 -0.312437876 -0.105484761
[51] -0.605077864 -0.184380733 -0.900279758 -0.006787933 0.384679863
[56] -0.400101718 1.267350099 -1.060708490 0.571575285 -0.827715988
[61] -0.825914706 -0.150589348 -1.978188205 -1.650241223 -1.440982080
[66] -1.379882951 0.507764649 0.137778541 -1.321938181 -0.007442038
[71] 0.439810384 -0.616763088 -0.523202989 -0.297094658 0.400083023
[76] 0.695420346 1.836241456 -1.710645954 -0.710110575 -0.814279700
[81] 1.124530224 1.012374113 -0.425351951 0.833348045 -0.629251841
[86] -0.449619672 -1.147550943 1.952013591 -0.475212372 0.152135693
[91] 1.002014426 0.260859195 -0.638781014 1.608471514 2.174754449
[96] -0.798041830 0.467136891 0.952479747 -1.326073627 1.117418597
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.6914206 0.4984112 -0.1892626 0.4169509 -1.923084 1.032621 -0.2532593
[2,] 0.6914206 0.4984112 -0.1892626 0.4169509 -1.923084 1.032621 -0.2532593
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.3585855 0.2392815 -0.4634537 1.586278 1.205729 0.5801234 2.268877
[2,] 0.3585855 0.2392815 -0.4634537 1.586278 1.205729 0.5801234 2.268877
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.4848249 -0.1069667 1.037584 0.2687884 -0.3276404 -1.294483 -0.5447104
[2,] -0.4848249 -0.1069667 1.037584 0.2687884 -0.3276404 -1.294483 -0.5447104
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.6558132 1.037281 -1.095087 0.9779136 -0.3421127 -0.6704131 1.460944
[2,] 0.6558132 1.037281 -1.095087 0.9779136 -0.3421127 -0.6704131 1.460944
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.3272899 1.007456 0.7091569 2.056097 -1.347124 -0.01533426 -2.095608
[2,] -0.3272899 1.007456 0.7091569 2.056097 -1.347124 -0.01533426 -2.095608
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.4578501 -0.8317 -0.3227901 -0.3894267 -0.7991423 0.5225049 0.1117703
[2,] -0.4578501 -0.8317 -0.3227901 -0.3894267 -0.7991423 0.5225049 0.1117703
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.565451 -3.716979 1.247353 -1.143164 -2.377069 0.6822679 -0.3124379
[2,] -1.565451 -3.716979 1.247353 -1.143164 -2.377069 0.6822679 -0.3124379
[,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.1054848 -0.6050779 -0.1843807 -0.9002798 -0.006787933 0.3846799
[2,] -0.1054848 -0.6050779 -0.1843807 -0.9002798 -0.006787933 0.3846799
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.4001017 1.26735 -1.060708 0.5715753 -0.827716 -0.8259147 -0.1505893
[2,] -0.4001017 1.26735 -1.060708 0.5715753 -0.827716 -0.8259147 -0.1505893
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -1.978188 -1.650241 -1.440982 -1.379883 0.5077646 0.1377785 -1.321938
[2,] -1.978188 -1.650241 -1.440982 -1.379883 0.5077646 0.1377785 -1.321938
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -0.007442038 0.4398104 -0.6167631 -0.523203 -0.2970947 0.400083 0.6954203
[2,] -0.007442038 0.4398104 -0.6167631 -0.523203 -0.2970947 0.400083 0.6954203
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 1.836241 -1.710646 -0.7101106 -0.8142797 1.12453 1.012374 -0.425352
[2,] 1.836241 -1.710646 -0.7101106 -0.8142797 1.12453 1.012374 -0.425352
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.833348 -0.6292518 -0.4496197 -1.147551 1.952014 -0.4752124 0.1521357
[2,] 0.833348 -0.6292518 -0.4496197 -1.147551 1.952014 -0.4752124 0.1521357
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 1.002014 0.2608592 -0.638781 1.608472 2.174754 -0.7980418 0.4671369
[2,] 1.002014 0.2608592 -0.638781 1.608472 2.174754 -0.7980418 0.4671369
[,98] [,99] [,100]
[1,] 0.9524797 -1.326074 1.117419
[2,] 0.9524797 -1.326074 1.117419
>
>
> Max(tmp2)
[1] 2.251298
> Min(tmp2)
[1] -1.914136
> mean(tmp2)
[1] 0.1165342
> Sum(tmp2)
[1] 11.65342
> Var(tmp2)
[1] 0.9264143
>
> rowMeans(tmp2)
[1] 1.162266945 0.298011579 1.007866199 -0.619164153 0.367759211
[6] -0.719084903 -0.443592468 1.246596981 1.622538412 1.760128255
[11] 0.710597859 0.291004325 -1.030917793 -1.067123356 1.050961518
[16] -1.695523949 1.203678555 1.041927121 -0.191967357 -0.084871503
[21] -0.665206057 -0.102708076 0.888317233 0.064138545 0.405074539
[26] -0.630210010 2.251297639 -1.362332269 -1.312255144 -1.598309699
[31] 0.036048723 0.527803782 1.071452942 0.942115245 -0.447228788
[36] -1.409263262 2.071764394 0.816322272 1.266289751 -0.645828590
[41] -0.076327312 2.226377428 -0.348349790 0.021604828 0.341696081
[46] -0.348928881 -0.788200233 0.416326902 -0.977649352 0.556908000
[51] 1.368699487 0.661228421 0.503879095 0.846983943 0.399374893
[56] -0.761977480 1.415598195 1.933941113 1.049511178 -0.000206435
[61] -1.482259233 0.032848190 0.644879833 0.191274026 0.041413270
[66] -1.466003776 -0.002479934 -0.444409188 -0.229243551 -1.483395810
[71] -0.458287341 0.390794127 -1.285386032 -0.395189210 0.923496841
[76] -0.801652606 -0.841348032 0.102821960 -0.039822724 1.103663199
[81] -1.914135549 0.793333670 1.194879175 0.165711446 -0.570843393
[86] 0.547841875 -0.253207862 0.806833987 0.517591112 -0.591360975
[91] -1.335622072 -0.951139341 -0.329169360 -1.389223727 1.613862433
[96] 0.875731398 0.924129540 -0.170377514 0.015463056 0.682545077
> rowSums(tmp2)
[1] 1.162266945 0.298011579 1.007866199 -0.619164153 0.367759211
[6] -0.719084903 -0.443592468 1.246596981 1.622538412 1.760128255
[11] 0.710597859 0.291004325 -1.030917793 -1.067123356 1.050961518
[16] -1.695523949 1.203678555 1.041927121 -0.191967357 -0.084871503
[21] -0.665206057 -0.102708076 0.888317233 0.064138545 0.405074539
[26] -0.630210010 2.251297639 -1.362332269 -1.312255144 -1.598309699
[31] 0.036048723 0.527803782 1.071452942 0.942115245 -0.447228788
[36] -1.409263262 2.071764394 0.816322272 1.266289751 -0.645828590
[41] -0.076327312 2.226377428 -0.348349790 0.021604828 0.341696081
[46] -0.348928881 -0.788200233 0.416326902 -0.977649352 0.556908000
[51] 1.368699487 0.661228421 0.503879095 0.846983943 0.399374893
[56] -0.761977480 1.415598195 1.933941113 1.049511178 -0.000206435
[61] -1.482259233 0.032848190 0.644879833 0.191274026 0.041413270
[66] -1.466003776 -0.002479934 -0.444409188 -0.229243551 -1.483395810
[71] -0.458287341 0.390794127 -1.285386032 -0.395189210 0.923496841
[76] -0.801652606 -0.841348032 0.102821960 -0.039822724 1.103663199
[81] -1.914135549 0.793333670 1.194879175 0.165711446 -0.570843393
[86] 0.547841875 -0.253207862 0.806833987 0.517591112 -0.591360975
[91] -1.335622072 -0.951139341 -0.329169360 -1.389223727 1.613862433
[96] 0.875731398 0.924129540 -0.170377514 0.015463056 0.682545077
> 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.162266945 0.298011579 1.007866199 -0.619164153 0.367759211
[6] -0.719084903 -0.443592468 1.246596981 1.622538412 1.760128255
[11] 0.710597859 0.291004325 -1.030917793 -1.067123356 1.050961518
[16] -1.695523949 1.203678555 1.041927121 -0.191967357 -0.084871503
[21] -0.665206057 -0.102708076 0.888317233 0.064138545 0.405074539
[26] -0.630210010 2.251297639 -1.362332269 -1.312255144 -1.598309699
[31] 0.036048723 0.527803782 1.071452942 0.942115245 -0.447228788
[36] -1.409263262 2.071764394 0.816322272 1.266289751 -0.645828590
[41] -0.076327312 2.226377428 -0.348349790 0.021604828 0.341696081
[46] -0.348928881 -0.788200233 0.416326902 -0.977649352 0.556908000
[51] 1.368699487 0.661228421 0.503879095 0.846983943 0.399374893
[56] -0.761977480 1.415598195 1.933941113 1.049511178 -0.000206435
[61] -1.482259233 0.032848190 0.644879833 0.191274026 0.041413270
[66] -1.466003776 -0.002479934 -0.444409188 -0.229243551 -1.483395810
[71] -0.458287341 0.390794127 -1.285386032 -0.395189210 0.923496841
[76] -0.801652606 -0.841348032 0.102821960 -0.039822724 1.103663199
[81] -1.914135549 0.793333670 1.194879175 0.165711446 -0.570843393
[86] 0.547841875 -0.253207862 0.806833987 0.517591112 -0.591360975
[91] -1.335622072 -0.951139341 -0.329169360 -1.389223727 1.613862433
[96] 0.875731398 0.924129540 -0.170377514 0.015463056 0.682545077
> rowMin(tmp2)
[1] 1.162266945 0.298011579 1.007866199 -0.619164153 0.367759211
[6] -0.719084903 -0.443592468 1.246596981 1.622538412 1.760128255
[11] 0.710597859 0.291004325 -1.030917793 -1.067123356 1.050961518
[16] -1.695523949 1.203678555 1.041927121 -0.191967357 -0.084871503
[21] -0.665206057 -0.102708076 0.888317233 0.064138545 0.405074539
[26] -0.630210010 2.251297639 -1.362332269 -1.312255144 -1.598309699
[31] 0.036048723 0.527803782 1.071452942 0.942115245 -0.447228788
[36] -1.409263262 2.071764394 0.816322272 1.266289751 -0.645828590
[41] -0.076327312 2.226377428 -0.348349790 0.021604828 0.341696081
[46] -0.348928881 -0.788200233 0.416326902 -0.977649352 0.556908000
[51] 1.368699487 0.661228421 0.503879095 0.846983943 0.399374893
[56] -0.761977480 1.415598195 1.933941113 1.049511178 -0.000206435
[61] -1.482259233 0.032848190 0.644879833 0.191274026 0.041413270
[66] -1.466003776 -0.002479934 -0.444409188 -0.229243551 -1.483395810
[71] -0.458287341 0.390794127 -1.285386032 -0.395189210 0.923496841
[76] -0.801652606 -0.841348032 0.102821960 -0.039822724 1.103663199
[81] -1.914135549 0.793333670 1.194879175 0.165711446 -0.570843393
[86] 0.547841875 -0.253207862 0.806833987 0.517591112 -0.591360975
[91] -1.335622072 -0.951139341 -0.329169360 -1.389223727 1.613862433
[96] 0.875731398 0.924129540 -0.170377514 0.015463056 0.682545077
>
> colMeans(tmp2)
[1] 0.1165342
> colSums(tmp2)
[1] 11.65342
> colVars(tmp2)
[1] 0.9264143
> colSd(tmp2)
[1] 0.9625042
> colMax(tmp2)
[1] 2.251298
> colMin(tmp2)
[1] -1.914136
> colMedians(tmp2)
[1] 0.05277591
> colRanges(tmp2)
[,1]
[1,] -1.914136
[2,] 2.251298
>
> 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] 2.5003961 -4.1020650 -8.1193304 -1.0873919 1.7419923 3.9340138
[7] -1.1799575 0.7778949 -3.5672486 -4.7928943
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.61883271
[2,] -0.06846097
[3,] 0.37478104
[4,] 0.77746262
[5,] 1.32122094
>
> rowApply(tmp,sum)
[1] -1.5692434 4.9380439 3.5942003 0.4159217 -0.3749886 -3.4758789
[7] -0.3634022 -2.6952558 -6.8490139 -7.5149734
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 5 3 8 10 2 4 10 9 8
[2,] 7 8 7 2 3 1 7 7 1 4
[3,] 1 6 8 7 1 5 1 8 3 2
[4,] 9 4 5 4 6 4 9 2 6 3
[5,] 5 2 6 5 9 10 6 4 8 7
[6,] 4 9 4 3 5 9 5 9 10 9
[7,] 2 10 9 1 8 8 2 6 7 6
[8,] 6 7 1 10 4 7 10 3 2 10
[9,] 3 3 2 6 7 3 3 5 5 5
[10,] 10 1 10 9 2 6 8 1 4 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 6.4781709 2.3929483 -4.0494159 -0.2104712 1.3606853 -1.4903997
[7] -2.9196228 3.0954959 2.3855789 1.3579621 -0.5022347 -2.6412160
[13] -0.9136582 0.5457315 -1.8837634 -3.3760784 -4.8378528 0.8654785
[19] 3.1170595 -1.2486513
> colApply(tmp,quantile)[,1]
[,1]
[1,] 0.2714483
[2,] 0.2898258
[3,] 1.4663334
[4,] 1.7373664
[5,] 2.7131971
>
> rowApply(tmp,sum)
[1] 2.046972 3.198850 -4.133948 -1.364604 -2.221523
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 20 14 19 13
[2,] 15 9 16 7 19
[3,] 2 1 11 11 6
[4,] 6 15 2 15 15
[5,] 16 18 10 3 12
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.4663334 0.5229348 -1.2511248 -0.4171735 1.091533951 0.1668721
[2,] 2.7131971 0.1667312 -1.8043561 0.8564975 1.313897575 -1.2057124
[3,] 0.2714483 0.3867156 0.1266673 -1.6853036 0.004017881 0.1433178
[4,] 1.7373664 -0.6057552 -0.1302917 0.4396161 -1.038952231 0.4869645
[5,] 0.2898258 1.9223219 -0.9903106 0.5958923 -0.009811923 -1.0818417
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.1859223 -0.35828496 0.1886416 0.1854596 0.4376092 -0.4308377
[2,] 0.2350431 0.21524955 1.8805646 1.2687273 -0.4375471 -0.8981710
[3,] -1.2830432 -0.07527051 1.3742172 0.3332823 -0.9143104 -1.1723043
[4,] -1.4488079 0.76263868 -0.7986994 0.6769663 -0.9888707 0.0190503
[5,] 0.7631075 2.55116311 -0.2591451 -1.1064734 1.4008843 -0.1589533
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.06909044 -1.4352323 0.04439654 -0.8614985 0.1892309 1.4011772
[2,] 0.27773499 0.5561425 -0.18241606 -0.9862215 -0.8725655 -1.2355361
[3,] -0.20754673 1.0568454 0.38745179 -0.2792303 -1.9102086 0.2492295
[4,] 0.07024765 -0.4210506 -1.76672687 -0.6981920 -0.1502823 2.6047103
[5,] -0.98500365 0.7890266 -0.36646879 -0.5509361 -2.0940274 -2.1541024
[,19] [,20]
[1,] 1.2609817 1.1009652
[2,] 0.4341687 0.9034212
[3,] 0.5581332 -1.4980566
[4,] 0.3099837 -0.4245190
[5,] 0.5537922 -1.3304622
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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.2083392 -1.06257 1.175468 1.007415 -0.5901154 1.408286 -0.1617668
col8 col9 col10 col11 col12 col13 col14
row1 -0.9772991 -0.3901417 -0.83931 0.7851213 1.114918 -0.121367 0.7111743
col15 col16 col17 col18 col19 col20
row1 -0.6163336 0.3486319 -1.484186 0.4080424 0.2453772 1.554363
> tmp[,"col10"]
col10
row1 -0.8393100
row2 0.1782911
row3 0.3881843
row4 -1.1435330
row5 -1.1538220
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.2083392 -1.0625702 1.1754683 1.0074147 -0.5901154 1.4082856
row5 1.2382076 0.2512235 -0.3827113 0.7579231 -0.2147809 -0.1628437
col7 col8 col9 col10 col11 col12 col13
row1 -0.1617668 -0.9772991 -0.3901417 -0.839310 0.7851213 1.114918 -0.1213670
row5 1.3603930 -0.8318188 1.0608816 -1.153822 1.5809337 1.105780 0.7774316
col14 col15 col16 col17 col18 col19 col20
row1 0.7111743 -0.6163336 0.3486319 -1.484186 0.4080424 0.2453772 1.554363
row5 1.8497689 -1.0085540 0.8722443 -1.277395 0.8355878 -0.1450431 0.663887
> tmp[,c("col6","col20")]
col6 col20
row1 1.4082856 1.5543635
row2 -0.7069830 -1.0980924
row3 2.2924531 0.9322458
row4 1.6964877 1.9330027
row5 -0.1628437 0.6638870
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.4082856 1.554363
row5 -0.1628437 0.663887
>
>
>
>
> 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.82327 51.01083 49.05951 50.05163 50.48915 103.84 50.3752 50.09511
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.38754 49.85964 49.23472 50.60889 50.33355 51.64869 51.04888 48.28495
col17 col18 col19 col20
row1 49.09517 50.42205 49.10972 104.8828
> tmp[,"col10"]
col10
row1 49.85964
row2 28.45677
row3 28.70904
row4 29.66528
row5 50.47271
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.82327 51.01083 49.05951 50.05163 50.48915 103.8400 50.37520 50.09511
row5 49.73838 50.91207 49.89489 48.66268 50.18187 103.6018 51.21194 48.92231
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.38754 49.85964 49.23472 50.60889 50.33355 51.64869 51.04888 48.28495
row5 49.27214 50.47271 49.23149 49.56042 50.24870 51.09021 49.79870 49.59452
col17 col18 col19 col20
row1 49.09517 50.42205 49.10972 104.8828
row5 50.83955 49.88065 47.07354 105.8153
> tmp[,c("col6","col20")]
col6 col20
row1 103.84000 104.88284
row2 75.38747 75.40708
row3 76.43706 72.87717
row4 73.81497 73.17401
row5 103.60180 105.81532
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.8400 104.8828
row5 103.6018 105.8153
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.8400 104.8828
row5 103.6018 105.8153
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.3157695
[2,] 0.1778216
[3,] -1.6480484
[4,] 0.6445210
[5,] -0.5482774
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.315551475 1.5819552
[2,] -0.007979103 -1.1468083
[3,] -1.553712541 -2.4603690
[4,] 0.543835184 -0.3677807
[5,] -0.676005656 -1.1379812
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.61081067 0.7723863
[2,] 0.54631085 -1.1054676
[3,] 1.57253519 2.2262981
[4,] 0.49718227 0.5662918
[5,] 0.05267943 1.0527164
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.6108107
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.6108107
[2,] 0.5463109
>
>
>
> 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]
row3 0.2718662 -0.09770956 -1.4798974 -0.5689798 -0.1696538 -1.0173073
row1 -0.2789506 0.23876209 0.5218729 -0.8572970 0.4830365 0.4166058
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.5066281 1.0938739 -0.4022576 -1.8849579 1.0664639 -0.8049014 -0.8153694
row1 0.6294961 0.1310265 -1.2826816 0.4690083 0.1904976 -1.2685195 -0.7930024
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.001780493 0.5193560 2.4471467 0.3958985 -0.3239863 0.1126838
row1 1.423043751 0.9060282 -0.6681675 -1.1596412 -0.1422530 1.0127626
[,20]
row3 -0.4465125
row1 1.3907785
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.2782744 0.2490509 -0.6228061 -0.0381957 0.9127651 -0.7722916 1.172314
[,8] [,9] [,10]
row2 -0.6226096 0.5765279 -1.331206
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.3564055 -0.4300583 -0.1931194 1.302972 1.159907 -2.226902 0.8247109
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.21557 0.08148465 0.0204208 -0.7434147 -0.1502703 -1.548575 0.3962075
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.8152095 0.2062928 -1.121444 -2.033291 0.3270349 -1.141858
>
>
> 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: 0x600001bdc300>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f20136ddc"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f5b9196f7"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f334e6118"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f5ec888f8"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f3f988265"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f3598d581"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f44e923a4"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f26230754"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f45b62f5b"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f3bdf231e"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f367aa547"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f2df8f442"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f336c30a2"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f3ecf60e"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMec3f3a0e1325"
>
>
> ### 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: 0x600001bf8240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001bf8240>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600001bf8240>
> rowMedians(tmp)
[1] -0.073314170 -0.123730920 0.194843820 -0.180294760 0.212263321
[6] -0.065381617 0.167382261 0.022188978 0.036340553 -0.120963427
[11] 0.117470774 0.326074262 0.391859669 0.262085928 0.225715112
[16] -0.101774066 -0.353801484 -0.247318987 -0.206067275 -0.155031979
[21] -0.084647884 -0.401504024 0.162583171 -0.666426644 0.256460269
[26] 0.445424216 0.103092269 -0.102855512 0.231235786 -0.217433287
[31] -0.206148912 -0.017044226 -0.427490192 0.501641163 0.109251201
[36] 0.182156496 -0.361617920 -0.155355792 -0.446698104 0.370677951
[41] 0.419902398 -0.156653110 0.094279065 -0.281782524 0.471058980
[46] 0.051453064 0.444231616 -0.196697624 0.401990491 0.105043701
[51] -0.046186889 -0.054722823 -0.769290842 0.030920970 -0.174008899
[56] -0.425423424 -0.565181989 -0.254092268 -0.045145237 0.249916293
[61] 0.171121816 -0.014152393 -0.348887812 0.292899599 0.302701091
[66] 0.116455095 -0.012098597 -0.095522861 -0.271348391 0.172564877
[71] -0.449564472 0.066385802 -0.442852187 -0.238069158 0.075463511
[76] -0.244212342 -0.289224449 0.624197972 -0.242235603 0.094412194
[81] -0.372708000 -0.009773880 0.041975138 -0.890576141 -0.014321401
[86] -0.302495610 -0.135362139 0.019700247 0.061826786 0.187585609
[91] -0.556241360 -0.702389464 0.223738608 -0.284247391 0.424648892
[96] 0.039260919 0.034989692 0.128016422 -0.117821864 0.286712239
[101] -0.209856889 0.327018179 -0.041686382 -0.003106938 -0.044462074
[106] 0.321129677 -0.199815618 -0.027755778 -0.219999451 0.365336598
[111] 0.159212360 0.544467621 -0.345145400 -0.625710477 -0.154409398
[116] -0.290803466 0.322273672 -0.246930027 -0.062023833 -0.020942653
[121] -0.357797268 -0.240788198 0.235299864 -0.159643985 -0.145676973
[126] 0.258741913 -0.161668736 0.115462564 -0.382062534 0.418444236
[131] 0.048028075 0.274240122 -0.130593355 -0.005576016 -0.311854908
[136] 0.098218718 0.051577528 -0.331692770 0.016142113 -0.276561432
[141] -0.288837173 -0.154175211 -1.030469367 0.051790073 -0.334472479
[146] -0.676735894 0.317080668 -0.003911490 -0.246859457 0.001665231
[151] -0.213072814 -0.077471406 -0.067359583 0.215420194 0.339534346
[156] 0.365847692 -0.315682903 -0.124257479 0.908307766 -0.144810723
[161] -0.182236712 0.202351849 0.230158506 -0.219660657 -0.298026324
[166] 0.133264749 0.491656615 -0.151023632 0.075951960 0.217102052
[171] 0.243288964 0.351500633 0.217894769 -0.035659085 0.635042233
[176] -0.209118815 -0.318010633 -0.410216052 0.035436468 -0.051452595
[181] -0.213403687 0.472847470 0.036202619 -0.160062043 0.239128342
[186] 0.098769276 0.024676433 -0.016242453 -0.351330497 -0.708003536
[191] -0.138903870 0.090687731 0.166241959 0.012384513 -0.531025746
[196] 0.203218753 -0.146564709 0.128511564 0.441312919 0.219133634
[201] -0.571470353 -0.013867437 -0.090285759 0.663025672 0.122487277
[206] -0.163202514 -0.016546123 -0.180656035 0.045467014 0.400381178
[211] -0.232955215 0.284991507 0.052368851 0.373123808 0.052305329
[216] -0.271521945 0.252196620 0.054825010 0.611213899 -0.168013624
[221] -0.134897068 0.494878141 -0.336120888 -0.282215435 0.389216069
[226] 0.334478884 0.045566454 -0.004509903 0.132556523 0.157745550
>
> proc.time()
user system elapsed
0.636 2.947 3.775
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 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: 0x60000175c120>
> .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: 0x60000175c120>
> .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: 0x60000175c120>
> .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: 0x60000175c120>
> 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: 0x60000174c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000174c360>
> .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: 0x60000174c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000174c360>
> .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: 0x60000174c360>
> 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: 0x6000017588a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000017588a0>
> .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: 0x6000017588a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000017588a0>
> .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: 0x6000017588a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000017588a0>
> .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: 0x6000017588a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000017588a0>
> .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: 0x6000017588a0>
> 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: 0x600001740060>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001740060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001740060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001740060>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileee503a88e212" "BufferedMatrixFileee5070b229c3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileee503a88e212" "BufferedMatrixFileee5070b229c3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001754720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001754720>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001754720>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001754720>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001754720>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001754720>
> .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: 0x600001754900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001754900>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001754900>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001754900>
> 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: 0x600001754ae0>
> .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: 0x600001754ae0>
> rm(P)
>
> proc.time()
user system elapsed
0.109 0.040 0.145
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 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.109 0.024 0.130