| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-04 11:35 -0400 (Mon, 04 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4989 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There" | 4719 |
| 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 262/2418 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 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.76.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.76.0.tar.gz |
| StartedAt: 2026-05-03 18:36:28 -0400 (Sun, 03 May 2026) |
| EndedAt: 2026-05-03 18:36:47 -0400 (Sun, 03 May 2026) |
| EllapsedTime: 19.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 Patched (2026-04-24 r89963)
* using platform: aarch64-apple-darwin23
* R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-05-03 22:36:28 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -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 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -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 -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 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.119 0.051 0.167
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 482663 25.8 1063027 56.8 NA 632020 33.8
Vcells 893071 6.9 8388608 64.0 196608 2112201 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] "Sun May 3 18:36:38 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] "Sun May 3 18:36:38 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: 0x6ffff80c0>
>
>
>
> 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] "Sun May 3 18:36:40 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] "Sun May 3 18:36:40 2026"
>
> ColMode(tmp2)
<pointer: 0x6ffff80c0>
>
>
>
> ### 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.8076154 -0.6628572 -1.2187578 0.92478749
[2,] 1.6884208 -1.6149213 -0.6812926 0.06178864
[3,] -1.8258962 -0.5232883 -0.5570473 -1.03308102
[4,] 0.4425047 0.5090108 0.3880390 0.76300483
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.8076154 0.6628572 1.2187578 0.92478749
[2,] 1.6884208 1.6149213 0.6812926 0.06178864
[3,] 1.8258962 0.5232883 0.5570473 1.03308102
[4,] 0.4425047 0.5090108 0.3880390 0.76300483
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9903761 0.8141604 1.1039736 0.9616587
[2,] 1.2993925 1.2707955 0.8254045 0.2485732
[3,] 1.3512573 0.7233867 0.7463560 1.0164059
[4,] 0.6652103 0.7134499 0.6229277 0.8735015
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.71138 33.80446 37.25849 35.54137
[2,] 39.68235 39.32288 33.93534 27.54752
[3,] 40.33847 32.75715 33.02061 36.19714
[4,] 32.09461 32.64351 31.61732 34.49802
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6ffff81e0>
> exp(tmp5)
<pointer: 0x6ffff81e0>
> log(tmp5,2)
<pointer: 0x6ffff81e0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.7073
> Min(tmp5)
[1] 52.63503
> mean(tmp5)
[1] 71.27783
> Sum(tmp5)
[1] 14255.57
> Var(tmp5)
[1] 857.966
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 87.20947 71.97348 73.00906 68.51285 68.11359 67.39262 67.66899 70.66368
[9] 69.03146 69.20312
> rowSums(tmp5)
[1] 1744.189 1439.470 1460.181 1370.257 1362.272 1347.852 1353.380 1413.274
[9] 1380.629 1384.062
> rowVars(tmp5)
[1] 8088.67999 54.14331 56.43014 33.37304 95.19395 48.63546
[7] 83.71018 59.96832 65.89932 70.76524
> rowSd(tmp5)
[1] 89.937089 7.358214 7.512000 5.776941 9.756739 6.973913 9.149327
[8] 7.743922 8.117840 8.412208
> rowMax(tmp5)
[1] 467.70729 85.13794 86.02116 79.56759 86.58274 78.12501 83.57050
[8] 86.13926 92.13230 83.30221
> rowMin(tmp5)
[1] 53.17812 57.33656 61.33458 57.59301 55.58191 55.75059 52.63503 59.47303
[9] 58.44941 55.44322
>
> colMeans(tmp5)
[1] 111.55744 71.77369 73.17471 70.37072 67.72223 69.81313 66.04324
[8] 69.00944 67.76184 69.29978 66.62267 76.40018 68.24263 66.41653
[15] 67.00933 69.15140 72.69964 65.35906 68.37889 68.75008
> colSums(tmp5)
[1] 1115.5744 717.7369 731.7471 703.7072 677.2223 698.1313 660.4324
[8] 690.0944 677.6184 692.9978 666.2267 764.0018 682.4263 664.1653
[15] 670.0933 691.5140 726.9964 653.5906 683.7889 687.5008
> colVars(tmp5)
[1] 15741.47502 28.09046 51.09590 42.49407 58.81083 98.95808
[7] 33.99998 65.33651 86.20340 67.09052 64.59087 112.92861
[13] 60.07513 69.32583 81.73327 48.49674 58.80997 28.20323
[19] 69.12959 52.54926
> colSd(tmp5)
[1] 125.465035 5.300043 7.148140 6.518748 7.668822 9.947768
[7] 5.830950 8.083100 9.284579 8.190881 8.036845 10.626788
[13] 7.750815 8.326214 9.040646 6.963960 7.668766 5.310672
[19] 8.314421 7.249087
> colMax(tmp5)
[1] 467.70729 81.84542 85.44309 78.11377 83.30221 82.13064 73.89000
[8] 86.02116 83.57050 86.58274 83.59225 92.13230 81.50572 84.25386
[15] 80.59186 80.21485 82.09478 71.98489 79.86738 77.88175
> colMin(tmp5)
[1] 55.97465 65.46249 61.77252 57.33656 60.12301 52.63503 55.44322 59.43019
[9] 57.59301 59.00082 57.66653 61.75804 57.17295 59.11221 54.40812 59.20630
[17] 57.08007 55.58191 53.17812 55.20364
>
>
> ### 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] 87.20947 71.97348 73.00906 68.51285 68.11359 67.39262 NA 70.66368
[9] 69.03146 69.20312
> rowSums(tmp5)
[1] 1744.189 1439.470 1460.181 1370.257 1362.272 1347.852 NA 1413.274
[9] 1380.629 1384.062
> rowVars(tmp5)
[1] 8088.67999 54.14331 56.43014 33.37304 95.19395 48.63546
[7] 88.34801 59.96832 65.89932 70.76524
> rowSd(tmp5)
[1] 89.937089 7.358214 7.512000 5.776941 9.756739 6.973913 9.399362
[8] 7.743922 8.117840 8.412208
> rowMax(tmp5)
[1] 467.70729 85.13794 86.02116 79.56759 86.58274 78.12501 NA
[8] 86.13926 92.13230 83.30221
> rowMin(tmp5)
[1] 53.17812 57.33656 61.33458 57.59301 55.58191 55.75059 NA 59.47303
[9] 58.44941 55.44322
>
> colMeans(tmp5)
[1] 111.55744 71.77369 73.17471 70.37072 67.72223 69.81313 66.04324
[8] 69.00944 67.76184 69.29978 66.62267 NA 68.24263 66.41653
[15] 67.00933 69.15140 72.69964 65.35906 68.37889 68.75008
> colSums(tmp5)
[1] 1115.5744 717.7369 731.7471 703.7072 677.2223 698.1313 660.4324
[8] 690.0944 677.6184 692.9978 666.2267 NA 682.4263 664.1653
[15] 670.0933 691.5140 726.9964 653.5906 683.7889 687.5008
> colVars(tmp5)
[1] 15741.47502 28.09046 51.09590 42.49407 58.81083 98.95808
[7] 33.99998 65.33651 86.20340 67.09052 64.59087 NA
[13] 60.07513 69.32583 81.73327 48.49674 58.80997 28.20323
[19] 69.12959 52.54926
> colSd(tmp5)
[1] 125.465035 5.300043 7.148140 6.518748 7.668822 9.947768
[7] 5.830950 8.083100 9.284579 8.190881 8.036845 NA
[13] 7.750815 8.326214 9.040646 6.963960 7.668766 5.310672
[19] 8.314421 7.249087
> colMax(tmp5)
[1] 467.70729 81.84542 85.44309 78.11377 83.30221 82.13064 73.89000
[8] 86.02116 83.57050 86.58274 83.59225 NA 81.50572 84.25386
[15] 80.59186 80.21485 82.09478 71.98489 79.86738 77.88175
> colMin(tmp5)
[1] 55.97465 65.46249 61.77252 57.33656 60.12301 52.63503 55.44322 59.43019
[9] 57.59301 59.00082 57.66653 NA 57.17295 59.11221 54.40812 59.20630
[17] 57.08007 55.58191 53.17812 55.20364
>
> Max(tmp5,na.rm=TRUE)
[1] 467.7073
> Min(tmp5,na.rm=TRUE)
[1] 52.63503
> mean(tmp5,na.rm=TRUE)
[1] 71.29831
> Sum(tmp5,na.rm=TRUE)
[1] 14188.36
> Var(tmp5,na.rm=TRUE)
[1] 862.2148
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.20947 71.97348 73.00906 68.51285 68.11359 67.39262 67.69355 70.66368
[9] 69.03146 69.20312
> rowSums(tmp5,na.rm=TRUE)
[1] 1744.189 1439.470 1460.181 1370.257 1362.272 1347.852 1286.178 1413.274
[9] 1380.629 1384.062
> rowVars(tmp5,na.rm=TRUE)
[1] 8088.67999 54.14331 56.43014 33.37304 95.19395 48.63546
[7] 88.34801 59.96832 65.89932 70.76524
> rowSd(tmp5,na.rm=TRUE)
[1] 89.937089 7.358214 7.512000 5.776941 9.756739 6.973913 9.399362
[8] 7.743922 8.117840 8.412208
> rowMax(tmp5,na.rm=TRUE)
[1] 467.70729 85.13794 86.02116 79.56759 86.58274 78.12501 83.57050
[8] 86.13926 92.13230 83.30221
> rowMin(tmp5,na.rm=TRUE)
[1] 53.17812 57.33656 61.33458 57.59301 55.58191 55.75059 52.63503 59.47303
[9] 58.44941 55.44322
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.55744 71.77369 73.17471 70.37072 67.72223 69.81313 66.04324
[8] 69.00944 67.76184 69.29978 66.62267 77.42218 68.24263 66.41653
[15] 67.00933 69.15140 72.69964 65.35906 68.37889 68.75008
> colSums(tmp5,na.rm=TRUE)
[1] 1115.5744 717.7369 731.7471 703.7072 677.2223 698.1313 660.4324
[8] 690.0944 677.6184 692.9978 666.2267 696.7996 682.4263 664.1653
[15] 670.0933 691.5140 726.9964 653.5906 683.7889 687.5008
> colVars(tmp5,na.rm=TRUE)
[1] 15741.47502 28.09046 51.09590 42.49407 58.81083 98.95808
[7] 33.99998 65.33651 86.20340 67.09052 64.59087 115.29443
[13] 60.07513 69.32583 81.73327 48.49674 58.80997 28.20323
[19] 69.12959 52.54926
> colSd(tmp5,na.rm=TRUE)
[1] 125.465035 5.300043 7.148140 6.518748 7.668822 9.947768
[7] 5.830950 8.083100 9.284579 8.190881 8.036845 10.737524
[13] 7.750815 8.326214 9.040646 6.963960 7.668766 5.310672
[19] 8.314421 7.249087
> colMax(tmp5,na.rm=TRUE)
[1] 467.70729 81.84542 85.44309 78.11377 83.30221 82.13064 73.89000
[8] 86.02116 83.57050 86.58274 83.59225 92.13230 81.50572 84.25386
[15] 80.59186 80.21485 82.09478 71.98489 79.86738 77.88175
> colMin(tmp5,na.rm=TRUE)
[1] 55.97465 65.46249 61.77252 57.33656 60.12301 52.63503 55.44322 59.43019
[9] 57.59301 59.00082 57.66653 61.75804 57.17295 59.11221 54.40812 59.20630
[17] 57.08007 55.58191 53.17812 55.20364
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.20947 71.97348 73.00906 68.51285 68.11359 67.39262 NaN 70.66368
[9] 69.03146 69.20312
> rowSums(tmp5,na.rm=TRUE)
[1] 1744.189 1439.470 1460.181 1370.257 1362.272 1347.852 0.000 1413.274
[9] 1380.629 1384.062
> rowVars(tmp5,na.rm=TRUE)
[1] 8088.67999 54.14331 56.43014 33.37304 95.19395 48.63546
[7] NA 59.96832 65.89932 70.76524
> rowSd(tmp5,na.rm=TRUE)
[1] 89.937089 7.358214 7.512000 5.776941 9.756739 6.973913 NA
[8] 7.743922 8.117840 8.412208
> rowMax(tmp5,na.rm=TRUE)
[1] 467.70729 85.13794 86.02116 79.56759 86.58274 78.12501 NA
[8] 86.13926 92.13230 83.30221
> rowMin(tmp5,na.rm=TRUE)
[1] 53.17812 57.33656 61.33458 57.59301 55.58191 55.75059 NA 59.47303
[9] 58.44941 55.44322
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 117.73330 71.49712 72.19770 70.47755 68.43102 71.72181 66.03324
[8] 70.07380 66.00532 70.44411 67.22806 NaN 67.30037 66.88426
[15] 68.40947 68.20857 72.55000 64.89335 67.78474 68.28032
> colSums(tmp5,na.rm=TRUE)
[1] 1059.5997 643.4741 649.7793 634.2980 615.8791 645.4963 594.2992
[8] 630.6642 594.0479 633.9970 605.0526 0.0000 605.7033 601.9584
[15] 615.6852 613.8771 652.9500 584.0401 610.0627 614.5229
> colVars(tmp5,na.rm=TRUE)
[1] 17280.06957 30.74122 46.74406 47.67743 60.51049 70.34350
[7] 38.24885 60.75888 62.26859 60.74507 68.54164 NA
[13] 57.59616 75.53038 69.89567 44.55833 65.90933 29.28869
[19] 73.79947 56.63535
> colSd(tmp5,na.rm=TRUE)
[1] 131.453678 5.544477 6.836963 6.904885 7.778849 8.387103
[7] 6.184565 7.794798 7.891045 7.793912 8.278988 NA
[13] 7.589213 8.690821 8.360363 6.675202 8.118456 5.411903
[19] 8.590662 7.525646
> colMax(tmp5,na.rm=TRUE)
[1] 467.70729 81.84542 85.44309 78.11377 83.30221 82.13064 73.89000
[8] 86.02116 82.24909 86.58274 83.59225 -Inf 81.50572 84.25386
[15] 80.59186 80.21485 82.09478 71.98489 79.86738 77.88175
> colMin(tmp5,na.rm=TRUE)
[1] 65.64958 65.46249 61.77252 57.33656 60.12301 57.05637 55.44322 62.01746
[9] 57.59301 61.68545 57.66653 Inf 57.17295 59.11221 55.75059 59.20630
[17] 57.08007 55.58191 53.17812 55.20364
>
>
>
>
> 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] 417.3642 170.9401 308.9909 188.2412 221.7481 329.5997 188.5012 221.8427
[9] 175.1210 202.3626
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 417.3642 170.9401 308.9909 188.2412 221.7481 329.5997 188.5012 221.8427
[9] 175.1210 202.3626
>
>
>
> 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.136868e-13 1.136868e-13 1.136868e-13 -1.705303e-13 -3.979039e-13
[6] 1.136868e-13 5.684342e-14 1.421085e-13 5.684342e-14 8.526513e-14
[11] 5.684342e-14 8.526513e-14 0.000000e+00 2.842171e-14 1.278977e-13
[16] 1.705303e-13 1.989520e-13 0.000000e+00 -1.421085e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 8
10 12
8 16
4 11
9 17
7 12
10 9
4 2
2 4
2 16
5 13
9 17
4 10
3 11
1 18
7 13
5 5
7 7
6 3
4 20
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] 1.935704
> Min(tmp)
[1] -2.491898
> mean(tmp)
[1] -0.05930741
> Sum(tmp)
[1] -5.930741
> Var(tmp)
[1] 1.060742
>
> rowMeans(tmp)
[1] -0.05930741
> rowSums(tmp)
[1] -5.930741
> rowVars(tmp)
[1] 1.060742
> rowSd(tmp)
[1] 1.029923
> rowMax(tmp)
[1] 1.935704
> rowMin(tmp)
[1] -2.491898
>
> colMeans(tmp)
[1] 0.170773514 -1.013623863 -0.015319446 -1.246224272 -1.367749933
[6] 0.287536600 0.223914368 1.626546015 0.890899493 1.250517252
[11] 0.071430309 0.340395894 0.543744762 -1.764635271 0.845103639
[16] 0.374606578 0.615434309 1.593870050 1.935703892 -0.114287114
[21] -1.761119412 -0.626028774 -0.287182402 0.615086680 -0.335641059
[26] 0.990249706 -1.766797665 1.821496904 -0.081484200 -0.981049414
[31] 1.508135888 -0.829755423 0.682134228 0.523315882 -1.723086515
[36] -1.060968039 -1.715457452 -1.884544480 1.318540982 0.211457299
[41] 0.001362444 0.796823147 0.682471848 -0.091038579 1.419759709
[46] 1.477108857 -1.723575559 -0.030687460 0.551856377 -0.750239637
[51] 1.654634031 1.089259882 0.223302156 0.830602592 0.238620241
[56] 0.503409410 0.245566756 -0.067297776 -0.673314003 1.158122925
[61] -0.401337585 0.966851877 -0.308697448 1.134034714 -0.930440026
[66] -1.052389363 -0.756349253 -0.199987110 -0.917070284 -0.345822972
[71] -0.203406600 -0.484623844 0.345514075 -0.737679276 0.186063835
[76] -0.328141650 0.526659687 1.420687484 -1.558090797 -0.076451647
[81] 0.967373752 -0.636690399 0.282055834 -0.138823997 -2.034340015
[86] 1.197417562 -0.982219742 -2.491897833 -0.612342632 -2.319635412
[91] 1.047001658 -0.280292670 0.350828467 -0.324276542 -1.133440488
[96] -0.914498901 1.075224320 -0.738820219 -1.774518981 -0.150855475
> colSums(tmp)
[1] 0.170773514 -1.013623863 -0.015319446 -1.246224272 -1.367749933
[6] 0.287536600 0.223914368 1.626546015 0.890899493 1.250517252
[11] 0.071430309 0.340395894 0.543744762 -1.764635271 0.845103639
[16] 0.374606578 0.615434309 1.593870050 1.935703892 -0.114287114
[21] -1.761119412 -0.626028774 -0.287182402 0.615086680 -0.335641059
[26] 0.990249706 -1.766797665 1.821496904 -0.081484200 -0.981049414
[31] 1.508135888 -0.829755423 0.682134228 0.523315882 -1.723086515
[36] -1.060968039 -1.715457452 -1.884544480 1.318540982 0.211457299
[41] 0.001362444 0.796823147 0.682471848 -0.091038579 1.419759709
[46] 1.477108857 -1.723575559 -0.030687460 0.551856377 -0.750239637
[51] 1.654634031 1.089259882 0.223302156 0.830602592 0.238620241
[56] 0.503409410 0.245566756 -0.067297776 -0.673314003 1.158122925
[61] -0.401337585 0.966851877 -0.308697448 1.134034714 -0.930440026
[66] -1.052389363 -0.756349253 -0.199987110 -0.917070284 -0.345822972
[71] -0.203406600 -0.484623844 0.345514075 -0.737679276 0.186063835
[76] -0.328141650 0.526659687 1.420687484 -1.558090797 -0.076451647
[81] 0.967373752 -0.636690399 0.282055834 -0.138823997 -2.034340015
[86] 1.197417562 -0.982219742 -2.491897833 -0.612342632 -2.319635412
[91] 1.047001658 -0.280292670 0.350828467 -0.324276542 -1.133440488
[96] -0.914498901 1.075224320 -0.738820219 -1.774518981 -0.150855475
> 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.170773514 -1.013623863 -0.015319446 -1.246224272 -1.367749933
[6] 0.287536600 0.223914368 1.626546015 0.890899493 1.250517252
[11] 0.071430309 0.340395894 0.543744762 -1.764635271 0.845103639
[16] 0.374606578 0.615434309 1.593870050 1.935703892 -0.114287114
[21] -1.761119412 -0.626028774 -0.287182402 0.615086680 -0.335641059
[26] 0.990249706 -1.766797665 1.821496904 -0.081484200 -0.981049414
[31] 1.508135888 -0.829755423 0.682134228 0.523315882 -1.723086515
[36] -1.060968039 -1.715457452 -1.884544480 1.318540982 0.211457299
[41] 0.001362444 0.796823147 0.682471848 -0.091038579 1.419759709
[46] 1.477108857 -1.723575559 -0.030687460 0.551856377 -0.750239637
[51] 1.654634031 1.089259882 0.223302156 0.830602592 0.238620241
[56] 0.503409410 0.245566756 -0.067297776 -0.673314003 1.158122925
[61] -0.401337585 0.966851877 -0.308697448 1.134034714 -0.930440026
[66] -1.052389363 -0.756349253 -0.199987110 -0.917070284 -0.345822972
[71] -0.203406600 -0.484623844 0.345514075 -0.737679276 0.186063835
[76] -0.328141650 0.526659687 1.420687484 -1.558090797 -0.076451647
[81] 0.967373752 -0.636690399 0.282055834 -0.138823997 -2.034340015
[86] 1.197417562 -0.982219742 -2.491897833 -0.612342632 -2.319635412
[91] 1.047001658 -0.280292670 0.350828467 -0.324276542 -1.133440488
[96] -0.914498901 1.075224320 -0.738820219 -1.774518981 -0.150855475
> colMin(tmp)
[1] 0.170773514 -1.013623863 -0.015319446 -1.246224272 -1.367749933
[6] 0.287536600 0.223914368 1.626546015 0.890899493 1.250517252
[11] 0.071430309 0.340395894 0.543744762 -1.764635271 0.845103639
[16] 0.374606578 0.615434309 1.593870050 1.935703892 -0.114287114
[21] -1.761119412 -0.626028774 -0.287182402 0.615086680 -0.335641059
[26] 0.990249706 -1.766797665 1.821496904 -0.081484200 -0.981049414
[31] 1.508135888 -0.829755423 0.682134228 0.523315882 -1.723086515
[36] -1.060968039 -1.715457452 -1.884544480 1.318540982 0.211457299
[41] 0.001362444 0.796823147 0.682471848 -0.091038579 1.419759709
[46] 1.477108857 -1.723575559 -0.030687460 0.551856377 -0.750239637
[51] 1.654634031 1.089259882 0.223302156 0.830602592 0.238620241
[56] 0.503409410 0.245566756 -0.067297776 -0.673314003 1.158122925
[61] -0.401337585 0.966851877 -0.308697448 1.134034714 -0.930440026
[66] -1.052389363 -0.756349253 -0.199987110 -0.917070284 -0.345822972
[71] -0.203406600 -0.484623844 0.345514075 -0.737679276 0.186063835
[76] -0.328141650 0.526659687 1.420687484 -1.558090797 -0.076451647
[81] 0.967373752 -0.636690399 0.282055834 -0.138823997 -2.034340015
[86] 1.197417562 -0.982219742 -2.491897833 -0.612342632 -2.319635412
[91] 1.047001658 -0.280292670 0.350828467 -0.324276542 -1.133440488
[96] -0.914498901 1.075224320 -0.738820219 -1.774518981 -0.150855475
> colMedians(tmp)
[1] 0.170773514 -1.013623863 -0.015319446 -1.246224272 -1.367749933
[6] 0.287536600 0.223914368 1.626546015 0.890899493 1.250517252
[11] 0.071430309 0.340395894 0.543744762 -1.764635271 0.845103639
[16] 0.374606578 0.615434309 1.593870050 1.935703892 -0.114287114
[21] -1.761119412 -0.626028774 -0.287182402 0.615086680 -0.335641059
[26] 0.990249706 -1.766797665 1.821496904 -0.081484200 -0.981049414
[31] 1.508135888 -0.829755423 0.682134228 0.523315882 -1.723086515
[36] -1.060968039 -1.715457452 -1.884544480 1.318540982 0.211457299
[41] 0.001362444 0.796823147 0.682471848 -0.091038579 1.419759709
[46] 1.477108857 -1.723575559 -0.030687460 0.551856377 -0.750239637
[51] 1.654634031 1.089259882 0.223302156 0.830602592 0.238620241
[56] 0.503409410 0.245566756 -0.067297776 -0.673314003 1.158122925
[61] -0.401337585 0.966851877 -0.308697448 1.134034714 -0.930440026
[66] -1.052389363 -0.756349253 -0.199987110 -0.917070284 -0.345822972
[71] -0.203406600 -0.484623844 0.345514075 -0.737679276 0.186063835
[76] -0.328141650 0.526659687 1.420687484 -1.558090797 -0.076451647
[81] 0.967373752 -0.636690399 0.282055834 -0.138823997 -2.034340015
[86] 1.197417562 -0.982219742 -2.491897833 -0.612342632 -2.319635412
[91] 1.047001658 -0.280292670 0.350828467 -0.324276542 -1.133440488
[96] -0.914498901 1.075224320 -0.738820219 -1.774518981 -0.150855475
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.1707735 -1.013624 -0.01531945 -1.246224 -1.36775 0.2875366 0.2239144
[2,] 0.1707735 -1.013624 -0.01531945 -1.246224 -1.36775 0.2875366 0.2239144
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.626546 0.8908995 1.250517 0.07143031 0.3403959 0.5437448 -1.764635
[2,] 1.626546 0.8908995 1.250517 0.07143031 0.3403959 0.5437448 -1.764635
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.8451036 0.3746066 0.6154343 1.59387 1.935704 -0.1142871 -1.761119
[2,] 0.8451036 0.3746066 0.6154343 1.59387 1.935704 -0.1142871 -1.761119
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.6260288 -0.2871824 0.6150867 -0.3356411 0.9902497 -1.766798 1.821497
[2,] -0.6260288 -0.2871824 0.6150867 -0.3356411 0.9902497 -1.766798 1.821497
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.0814842 -0.9810494 1.508136 -0.8297554 0.6821342 0.5233159 -1.723087
[2,] -0.0814842 -0.9810494 1.508136 -0.8297554 0.6821342 0.5233159 -1.723087
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.060968 -1.715457 -1.884544 1.318541 0.2114573 0.001362444 0.7968231
[2,] -1.060968 -1.715457 -1.884544 1.318541 0.2114573 0.001362444 0.7968231
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.6824718 -0.09103858 1.41976 1.477109 -1.723576 -0.03068746 0.5518564
[2,] 0.6824718 -0.09103858 1.41976 1.477109 -1.723576 -0.03068746 0.5518564
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.7502396 1.654634 1.08926 0.2233022 0.8306026 0.2386202 0.5034094
[2,] -0.7502396 1.654634 1.08926 0.2233022 0.8306026 0.2386202 0.5034094
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.2455668 -0.06729778 -0.673314 1.158123 -0.4013376 0.9668519 -0.3086974
[2,] 0.2455668 -0.06729778 -0.673314 1.158123 -0.4013376 0.9668519 -0.3086974
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.134035 -0.93044 -1.052389 -0.7563493 -0.1999871 -0.9170703 -0.345823
[2,] 1.134035 -0.93044 -1.052389 -0.7563493 -0.1999871 -0.9170703 -0.345823
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.2034066 -0.4846238 0.3455141 -0.7376793 0.1860638 -0.3281416 0.5266597
[2,] -0.2034066 -0.4846238 0.3455141 -0.7376793 0.1860638 -0.3281416 0.5266597
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.420687 -1.558091 -0.07645165 0.9673738 -0.6366904 0.2820558 -0.138824
[2,] 1.420687 -1.558091 -0.07645165 0.9673738 -0.6366904 0.2820558 -0.138824
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -2.03434 1.197418 -0.9822197 -2.491898 -0.6123426 -2.319635 1.047002
[2,] -2.03434 1.197418 -0.9822197 -2.491898 -0.6123426 -2.319635 1.047002
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.2802927 0.3508285 -0.3242765 -1.13344 -0.9144989 1.075224 -0.7388202
[2,] -0.2802927 0.3508285 -0.3242765 -1.13344 -0.9144989 1.075224 -0.7388202
[,99] [,100]
[1,] -1.774519 -0.1508555
[2,] -1.774519 -0.1508555
>
>
> Max(tmp2)
[1] 2.591585
> Min(tmp2)
[1] -2.709509
> mean(tmp2)
[1] 0.04617718
> Sum(tmp2)
[1] 4.617718
> Var(tmp2)
[1] 1.058381
>
> rowMeans(tmp2)
[1] 1.664363510 0.993259071 -0.485320082 -1.228655714 -0.781848787
[6] -0.139121573 1.919066354 0.382334113 0.468231375 1.488561045
[11] 0.613800515 -1.057297794 -0.686487444 0.892182597 -0.434533998
[16] -0.489763851 0.844436098 0.364572993 -0.736462217 0.505816112
[21] -1.294773684 -0.141559278 -0.149594195 -1.417302865 0.416249018
[26] 1.117508720 0.878309103 -0.164666766 -2.097104409 1.899533965
[31] -0.088971514 2.285640840 -0.230919615 -0.792769222 0.575697896
[36] 1.326308132 -0.034673976 -0.879686059 0.380349584 1.156666322
[41] -1.626584642 0.048416357 -0.601487856 0.609240558 -1.443361703
[46] -0.682680138 0.491530265 -0.556812458 0.503608253 1.288504957
[51] 1.446999279 0.774570041 -0.091478660 0.380006993 0.762403638
[56] -0.249141317 1.748509741 2.591584806 -1.576870163 0.953150100
[61] -0.002969702 0.556397490 -0.056485737 1.097301525 -0.375686245
[66] 0.203474083 0.076671588 0.071400889 0.548319507 -1.288978739
[71] 0.397541751 -2.709509286 -1.845023877 0.808126286 -0.245340350
[76] 0.270208628 0.991701792 -1.238945760 -0.696533179 -1.958184742
[81] 0.442469697 -2.001798162 0.738028385 -0.303260806 -0.499667633
[86] 0.586198206 1.514054030 -1.021850604 -0.384911546 -0.812932779
[91] 1.178721853 -0.795819251 0.499379631 0.819458143 -0.355703823
[96] -0.315727360 -1.606734829 -0.425256601 0.819715332 0.328388072
> rowSums(tmp2)
[1] 1.664363510 0.993259071 -0.485320082 -1.228655714 -0.781848787
[6] -0.139121573 1.919066354 0.382334113 0.468231375 1.488561045
[11] 0.613800515 -1.057297794 -0.686487444 0.892182597 -0.434533998
[16] -0.489763851 0.844436098 0.364572993 -0.736462217 0.505816112
[21] -1.294773684 -0.141559278 -0.149594195 -1.417302865 0.416249018
[26] 1.117508720 0.878309103 -0.164666766 -2.097104409 1.899533965
[31] -0.088971514 2.285640840 -0.230919615 -0.792769222 0.575697896
[36] 1.326308132 -0.034673976 -0.879686059 0.380349584 1.156666322
[41] -1.626584642 0.048416357 -0.601487856 0.609240558 -1.443361703
[46] -0.682680138 0.491530265 -0.556812458 0.503608253 1.288504957
[51] 1.446999279 0.774570041 -0.091478660 0.380006993 0.762403638
[56] -0.249141317 1.748509741 2.591584806 -1.576870163 0.953150100
[61] -0.002969702 0.556397490 -0.056485737 1.097301525 -0.375686245
[66] 0.203474083 0.076671588 0.071400889 0.548319507 -1.288978739
[71] 0.397541751 -2.709509286 -1.845023877 0.808126286 -0.245340350
[76] 0.270208628 0.991701792 -1.238945760 -0.696533179 -1.958184742
[81] 0.442469697 -2.001798162 0.738028385 -0.303260806 -0.499667633
[86] 0.586198206 1.514054030 -1.021850604 -0.384911546 -0.812932779
[91] 1.178721853 -0.795819251 0.499379631 0.819458143 -0.355703823
[96] -0.315727360 -1.606734829 -0.425256601 0.819715332 0.328388072
> 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.664363510 0.993259071 -0.485320082 -1.228655714 -0.781848787
[6] -0.139121573 1.919066354 0.382334113 0.468231375 1.488561045
[11] 0.613800515 -1.057297794 -0.686487444 0.892182597 -0.434533998
[16] -0.489763851 0.844436098 0.364572993 -0.736462217 0.505816112
[21] -1.294773684 -0.141559278 -0.149594195 -1.417302865 0.416249018
[26] 1.117508720 0.878309103 -0.164666766 -2.097104409 1.899533965
[31] -0.088971514 2.285640840 -0.230919615 -0.792769222 0.575697896
[36] 1.326308132 -0.034673976 -0.879686059 0.380349584 1.156666322
[41] -1.626584642 0.048416357 -0.601487856 0.609240558 -1.443361703
[46] -0.682680138 0.491530265 -0.556812458 0.503608253 1.288504957
[51] 1.446999279 0.774570041 -0.091478660 0.380006993 0.762403638
[56] -0.249141317 1.748509741 2.591584806 -1.576870163 0.953150100
[61] -0.002969702 0.556397490 -0.056485737 1.097301525 -0.375686245
[66] 0.203474083 0.076671588 0.071400889 0.548319507 -1.288978739
[71] 0.397541751 -2.709509286 -1.845023877 0.808126286 -0.245340350
[76] 0.270208628 0.991701792 -1.238945760 -0.696533179 -1.958184742
[81] 0.442469697 -2.001798162 0.738028385 -0.303260806 -0.499667633
[86] 0.586198206 1.514054030 -1.021850604 -0.384911546 -0.812932779
[91] 1.178721853 -0.795819251 0.499379631 0.819458143 -0.355703823
[96] -0.315727360 -1.606734829 -0.425256601 0.819715332 0.328388072
> rowMin(tmp2)
[1] 1.664363510 0.993259071 -0.485320082 -1.228655714 -0.781848787
[6] -0.139121573 1.919066354 0.382334113 0.468231375 1.488561045
[11] 0.613800515 -1.057297794 -0.686487444 0.892182597 -0.434533998
[16] -0.489763851 0.844436098 0.364572993 -0.736462217 0.505816112
[21] -1.294773684 -0.141559278 -0.149594195 -1.417302865 0.416249018
[26] 1.117508720 0.878309103 -0.164666766 -2.097104409 1.899533965
[31] -0.088971514 2.285640840 -0.230919615 -0.792769222 0.575697896
[36] 1.326308132 -0.034673976 -0.879686059 0.380349584 1.156666322
[41] -1.626584642 0.048416357 -0.601487856 0.609240558 -1.443361703
[46] -0.682680138 0.491530265 -0.556812458 0.503608253 1.288504957
[51] 1.446999279 0.774570041 -0.091478660 0.380006993 0.762403638
[56] -0.249141317 1.748509741 2.591584806 -1.576870163 0.953150100
[61] -0.002969702 0.556397490 -0.056485737 1.097301525 -0.375686245
[66] 0.203474083 0.076671588 0.071400889 0.548319507 -1.288978739
[71] 0.397541751 -2.709509286 -1.845023877 0.808126286 -0.245340350
[76] 0.270208628 0.991701792 -1.238945760 -0.696533179 -1.958184742
[81] 0.442469697 -2.001798162 0.738028385 -0.303260806 -0.499667633
[86] 0.586198206 1.514054030 -1.021850604 -0.384911546 -0.812932779
[91] 1.178721853 -0.795819251 0.499379631 0.819458143 -0.355703823
[96] -0.315727360 -1.606734829 -0.425256601 0.819715332 0.328388072
>
> colMeans(tmp2)
[1] 0.04617718
> colSums(tmp2)
[1] 4.617718
> colVars(tmp2)
[1] 1.058381
> colSd(tmp2)
[1] 1.028777
> colMax(tmp2)
[1] 2.591585
> colMin(tmp2)
[1] -2.709509
> colMedians(tmp2)
[1] 0.05990862
> colRanges(tmp2)
[,1]
[1,] -2.709509
[2,] 2.591585
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.2404226 -0.2489040 1.1509799 -1.0001427 -0.9015832 2.8163403
[7] -0.1295065 1.5309409 -0.2666843 -1.3754621
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2188068
[2,] -1.0469981
[3,] -0.1180092
[4,] 0.5973941
[5,] 1.4201094
>
> rowApply(tmp,sum)
[1] -0.03565766 6.57173123 -5.20664980 2.53406764 0.46001901 1.42275209
[7] -1.81802239 -3.52435436 2.12715613 -2.19548625
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 4 4 4 1 9 10 3 7 2
[2,] 10 7 3 5 7 2 5 10 1 10
[3,] 9 5 9 7 2 7 4 4 4 7
[4,] 4 3 10 1 10 1 6 5 10 1
[5,] 3 9 2 9 4 6 1 1 6 8
[6,] 2 8 8 8 3 4 9 7 9 5
[7,] 7 2 1 3 5 10 8 6 8 4
[8,] 5 6 6 2 9 8 7 2 3 9
[9,] 8 1 7 6 6 3 3 9 5 6
[10,] 1 10 5 10 8 5 2 8 2 3
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.24446447 0.04082059 -4.13431688 1.06220959 -4.66081460 2.74055635
[7] -0.82616130 -0.33963334 -0.98069192 -1.61309902 1.74065237 -3.63809628
[13] 4.04025004 -0.06334785 -1.36054053 -1.90221411 2.40424557 -2.39636240
[19] -0.42732995 -0.96862300
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.6602857
[2,] -0.5984997
[3,] 0.1193787
[4,] 1.1973626
[5,] 2.1865086
>
> rowApply(tmp,sum)
[1] -3.4661900 -9.5264152 0.6652178 9.1279421 -5.8385870
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 15 20 2 8
[2,] 6 18 9 18 3
[3,] 2 4 1 8 9
[4,] 13 14 3 10 20
[5,] 8 5 6 3 2
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.1973626 -0.6554884 -1.2549678 0.104343408 -0.4884241 0.620236500
[2,] 0.1193787 1.4384973 -1.6073924 -0.008794367 -1.3457893 -0.526465258
[3,] 2.1865086 -0.4150126 -0.9987979 -0.862372545 -0.5044473 0.005572473
[4,] -0.6602857 1.1158369 0.1637159 0.294661750 -0.5889289 2.037816391
[5,] -0.5984997 -1.4430126 -0.4368747 1.534371340 -1.7332250 0.603396241
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.7889060 -1.1212618 0.2531806 -0.1107109 0.9108502 -0.3400704
[2,] -0.4257371 0.4399251 -4.0432492 -0.3246422 0.7424325 -2.3757930
[3,] -0.8297544 -0.7125885 1.0096361 -0.4754435 1.1693950 -0.8925102
[4,] 1.1077122 -0.1705455 0.8791473 0.6187401 -0.7791770 0.7937894
[5,] 0.1105241 1.2248373 0.9205933 -1.3210426 -0.3028483 -0.8235120
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.8970317 -0.43094056 -0.6244192 -1.6010612 0.8579757 -0.9355523
[2,] 2.1858212 -0.90907512 -0.4039692 -0.7838643 1.8554793 -2.0359735
[3,] -0.4608252 0.19032402 0.3315799 0.6604406 0.8334001 0.3747340
[4,] 0.4137555 0.03674482 0.4881721 -0.0929921 0.2683257 0.6212300
[5,] 1.0044669 1.04959899 -1.1519042 -0.0847371 -1.4109353 -0.4208005
[,19] [,20]
[1,] -0.18104499 0.2256771
[2,] -0.55751164 -0.9596928
[3,] 0.40162108 -0.3462417
[4,] -0.18981837 2.7700417
[5,] 0.09942397 -2.6584073
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.240899 -0.07419807 -0.5843604 -0.6824421 -0.5719152 0.4225214 0.457627
col8 col9 col10 col11 col12 col13 col14
row1 0.1867245 0.7262298 1.292982 0.701264 -1.395518 0.4088533 -0.02725761
col15 col16 col17 col18 col19 col20
row1 0.7513075 0.9113684 -0.3107714 0.3373895 -1.212506 0.3945087
> tmp[,"col10"]
col10
row1 1.29298187
row2 -0.65370317
row3 1.26761133
row4 1.30808646
row5 0.08909331
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.2408994 -0.07419807 -0.5843604 -0.6824421 -0.5719152 0.4225214 0.457627
row5 -0.7738687 0.92232045 0.4569607 1.1396721 -0.3248186 0.8102079 1.103849
col8 col9 col10 col11 col12 col13
row1 0.18672449 0.72622978 1.29298187 0.7012640 -1.3955183 0.4088533
row5 -0.08161481 0.06647584 0.08909331 -0.3323061 -0.4148457 0.7719193
col14 col15 col16 col17 col18 col19
row1 -0.02725761 0.7513075 0.9113684 -0.3107714 0.3373895 -1.21250554
row5 1.33088116 0.3419348 -0.7683038 1.5264355 -0.2150639 -0.05724746
col20
row1 0.3945087
row5 1.3151476
> tmp[,c("col6","col20")]
col6 col20
row1 0.4225214 0.3945087
row2 -1.2827775 0.9547799
row3 1.2684381 -1.4330010
row4 0.3054192 1.1193086
row5 0.8102079 1.3151476
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.4225214 0.3945087
row5 0.8102079 1.3151476
>
>
>
>
> 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.84899 50.95972 50.71401 50.61019 48.74297 103.9437 49.61666 50.54454
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.21528 51.68094 49.8847 50.63206 49.92053 49.86755 52.3587 49.13138
col17 col18 col19 col20
row1 48.75432 50.02251 51.97498 105.8036
> tmp[,"col10"]
col10
row1 51.68094
row2 29.13251
row3 30.50702
row4 29.89760
row5 50.00628
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.84899 50.95972 50.71401 50.61019 48.74297 103.9437 49.61666 50.54454
row5 49.39893 48.24380 49.28635 49.65802 49.64264 105.4339 51.26269 48.61086
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.21528 51.68094 49.88470 50.63206 49.92053 49.86755 52.35870 49.13138
row5 50.65127 50.00628 50.34617 49.37620 49.78805 50.01168 50.72644 50.88119
col17 col18 col19 col20
row1 48.75432 50.02251 51.97498 105.8036
row5 50.96976 49.37200 49.79141 105.3497
> tmp[,c("col6","col20")]
col6 col20
row1 103.94368 105.80356
row2 75.07868 75.13884
row3 75.71792 74.31224
row4 75.50115 75.43056
row5 105.43388 105.34968
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.9437 105.8036
row5 105.4339 105.3497
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.9437 105.8036
row5 105.4339 105.3497
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.17343257
[2,] 0.05337938
[3,] 0.68320567
[4,] -0.35432823
[5,] -1.43026084
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.1853884 0.16439770
[2,] 1.9705005 3.13758943
[3,] 0.5291024 -0.85668500
[4,] 0.6566745 -0.09076295
[5,] 1.3162113 0.50340831
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2449193 1.57937886
[2,] 0.6939114 -0.78492883
[3,] -0.5259176 0.41012701
[4,] 0.8021402 0.08171324
[5,] -1.4016778 -0.54184692
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2449193
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2449193
[2,] 0.6939114
>
>
>
> 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 1.130159 1.276992 -0.3135546 1.230064 0.1419046 -0.8036987 -0.7222676
row1 -1.845930 1.194013 -1.0999168 1.016111 0.5652484 0.6816184 0.2544877
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.78723448 -1.2317248 1.653684 0.43059559 0.4876958 -0.7771659
row1 -0.02089068 0.1685744 -1.360262 -0.02137837 -0.1151908 0.7003930
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.2633555 0.29717004 0.04244898 1.235605 -1.90576 -0.6089497 1.8632785
row1 0.4169980 -0.06995488 -0.53409472 1.113878 1.23980 -0.2973319 -0.7633627
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.779389 -0.05855062 1.85397 -0.6353972 -0.577772 0.3240927 -0.1517389
[,8] [,9] [,10]
row2 -2.557782 0.01787318 -1.072074
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.7456892 1.417451 1.26831 2.074092 -0.4169037 0.3941844 -0.4326617
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3475511 -0.7349087 -1.016177 1.100382 0.3322115 -0.569887 -2.339677
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.92432 0.3106141 -2.356077 1.539273 0.186979 -1.237236
>
>
> 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: 0x6ffff8780>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f645a97455"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f678149c2d"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f611198bf2"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f62432c5a3"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f614d62e6"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f67f97eab4"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f64eb210dd"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f6c714588"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f6608bea19"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f61b640d4"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f6645a1f2c"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f658b4b52c"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f63fe28933"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f6319d9409"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMe4f66061f451"
>
>
> ### 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: 0x6ffff9260>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6ffff9260>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6ffff9260>
> rowMedians(tmp)
[1] -0.2308977084 0.1091032272 0.1126355614 -0.1209446862 0.2915773813
[6] 0.2386208335 0.0878690421 -0.4792235858 -0.5015521223 -0.6317269126
[11] 0.1478944920 -0.4335226396 0.1086544991 -0.4509041932 -0.1899113852
[16] -0.2082953857 -0.7782727243 0.3511239628 -0.1051140703 0.0169122256
[21] 0.0216912867 -0.0082209020 0.2548687141 -0.1731865872 0.1788899771
[26] -0.2008125959 0.2012832730 0.2866863630 0.5697217006 -0.2125459923
[31] -0.6160884298 0.5015897695 -0.0165139797 0.6951590101 -0.6062771729
[36] 0.0490258312 0.0704469830 0.3096180317 -0.1062188327 0.4347328576
[41] 0.1455150441 0.2011236247 0.1802879937 0.0577179227 -0.1350098030
[46] -0.3359642050 -0.1237856998 -0.3571047538 0.6776099754 -0.4030037975
[51] -0.3981885846 -0.5993858072 0.0341878292 0.1143510966 0.0196274934
[56] -0.1620207778 0.1204517168 0.4677000281 0.0206767369 0.3619217657
[61] -0.2675993563 0.0904670056 -0.2373914901 0.3264225450 0.0816529586
[66] 0.1077449487 -0.6055227158 -0.3761338694 -0.1252379231 0.4056990012
[71] -0.0011269893 -0.2091226372 -0.0847144311 -0.0880206252 -0.2251540602
[76] -0.7904029648 0.0421424509 0.4754201349 0.1382186942 -0.1927220134
[81] 0.1380934343 -0.2779045870 0.1567118731 0.3210723752 -0.6677464252
[86] 0.2990236260 -0.1391931893 -0.0043449520 0.1621197517 -0.2467200104
[91] -0.3928036442 0.1699862301 0.0557642489 0.1832192330 -0.2307893128
[96] 0.1097678087 -0.0873751600 -0.1028567548 0.0725664815 -0.3639589655
[101] -0.4756672764 0.0648225535 -0.1145659292 -0.6698636802 0.3308931006
[106] 0.6793614913 0.1275401653 -0.0007287318 -0.7340448362 0.2527317019
[111] 0.0092836201 -0.3197275036 0.3521789604 0.0683381937 -0.1562270813
[116] -0.1152487653 0.1537868547 0.1650750007 -0.2013283342 -0.0286524642
[121] 0.3418999604 -0.0964475735 0.0959551679 -0.4110792128 -0.1819162096
[126] 0.5185547115 -0.4646849256 -0.1977091589 0.1249095413 -0.4627311532
[131] 0.6015816724 -0.1523171921 0.3858864286 0.5575641209 0.1870487317
[136] 0.2072055401 -0.3113233249 0.1936144791 0.2523358396 -0.2346218450
[141] 0.1508672996 0.0723874708 -0.5243544031 0.3642481624 0.2763338829
[146] 0.7821185480 0.6686323552 -0.3293135620 -1.1268165219 -0.2234730067
[151] 0.2409452188 -0.4485610377 0.6230005984 1.0318121395 -0.1553301200
[156] 0.3006672056 0.0902946462 0.5448154086 -0.1839957100 0.0504211906
[161] -0.3463499993 0.2917800524 0.3640855894 0.0377302972 -0.5530766854
[166] -0.3971729795 -0.2610993397 0.0827980907 -0.1534294682 -0.2423962667
[171] 0.0908379956 -0.1856453202 -0.2678675885 0.8428758759 0.2798795799
[176] -0.1056639558 -0.0263351169 -0.4218634861 -0.7456707753 0.5335372128
[181] 0.3573636516 0.2197071126 0.1408731484 -0.3980578219 -0.4006765077
[186] 0.2734741700 0.4756246693 -0.1381150613 -0.2357841178 0.1302220307
[191] 0.5132219767 -0.3648744897 0.3850756582 0.2855166288 0.4689627758
[196] 0.1244425208 -0.1116455304 0.0893125969 0.2193852004 0.0261282285
[201] 0.4058683442 -0.0948562862 0.0492781181 -0.0174885040 0.4608295555
[206] 0.1089495722 0.1130446356 -0.0281553491 0.4657557523 -0.6009942810
[211] 0.4314909172 -0.0937620202 -0.1160066856 0.1481213121 -0.4763776116
[216] -0.2386068874 -0.2754051754 -0.4498586277 -0.2829036876 -0.4469021818
[221] -0.2450797346 0.1574777962 -0.0665444928 -0.2522482826 -0.3363015701
[226] 0.2825929488 -0.0234257164 0.1209506246 0.1703551873 0.1707802510
>
> proc.time()
user system elapsed
0.723 4.862 5.659
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x1018a2170>
> .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: 0x1018a2170>
> .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: 0x1018a2170>
> .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: 0x1018a2170>
> 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: 0x76cf54000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54000>
> .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: 0x76cf54000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54000>
> .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: 0x76cf54000>
> 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: 0x76cf54240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54240>
> .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: 0x76cf54240>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x76cf54240>
> .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: 0x76cf54240>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x76cf54240>
> .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: 0x76cf54240>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x76cf54240>
> .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: 0x76cf54240>
> 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: 0x76cf54360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x76cf54360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee8133c8a12f7" "BufferedMatrixFilee8135cd752ff"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee8133c8a12f7" "BufferedMatrixFilee8135cd752ff"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54480>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x76cf54480>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x76cf54480>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x76cf54480>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x76cf54480>
> .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: 0x76cf54600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x76cf54600>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x76cf54600>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x76cf54600>
> 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: 0x76cf54720>
> .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: 0x76cf54720>
> rm(P)
>
> proc.time()
user system elapsed
0.118 0.051 0.163
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.120 0.032 0.147