| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-18 11:36 -0400 (Sat, 18 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 alpha (2026-04-05 r89794) | 4957 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-04-08 r89818) | 4686 |
| kunpeng2 | Linux (openEuler 24.03 LTS) | aarch64 | R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" | 4627 |
| 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 259/2404 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.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 | |||||||||
| kunpeng2 | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-04-17 18:42:45 -0400 (Fri, 17 Apr 2026) |
| EndedAt: 2026-04-17 18:43:08 -0400 (Fri, 17 Apr 2026) |
| EllapsedTime: 22.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 alpha (2026-04-08 r89818)
* 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-04-17 22:42:46 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -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 alpha (2026-04-08 r89818)
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.120 0.048 0.162
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
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 484141 25.9 1067251 57 NA 632017 33.8
Vcells 896965 6.9 8388608 64 196608 2112089 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] "Fri Apr 17 18:42:56 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] "Fri Apr 17 18:42:56 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: 0x101e3ac60>
>
>
>
> 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] "Fri Apr 17 18:42:58 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] "Fri Apr 17 18:42:58 2026"
>
> ColMode(tmp2)
<pointer: 0x101e3ac60>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.3565155 0.6382904 0.2017803 -0.7794057
[2,] 0.7359740 0.9163691 -0.7803751 -1.0872476
[3,] 0.3905846 -0.2769498 0.1399980 -0.2948494
[4,] -0.6393509 -0.5965935 -0.3612244 -0.1901902
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.3565155 0.6382904 0.2017803 0.7794057
[2,] 0.7359740 0.9163691 0.7803751 1.0872476
[3,] 0.3905846 0.2769498 0.1399980 0.2948494
[4,] 0.6393509 0.5965935 0.3612244 0.1901902
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0178099 0.7989308 0.4491996 0.8828395
[2,] 0.8578893 0.9572717 0.8833884 1.0427117
[3,] 0.6249677 0.5262602 0.3741630 0.5430004
[4,] 0.7995942 0.7723947 0.6010195 0.4361080
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.53461 33.62760 29.69378 34.60780
[2,] 34.31487 35.48909 34.61426 36.51436
[3,] 31.64026 30.53955 28.88163 30.72485
[4,] 33.63529 33.32054 31.37142 29.55127
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x101e3acc0>
> exp(tmp5)
<pointer: 0x101e3acc0>
> log(tmp5,2)
<pointer: 0x101e3acc0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.4208
> Min(tmp5)
[1] 53.68956
> mean(tmp5)
[1] 73.613
> Sum(tmp5)
[1] 14722.6
> Var(tmp5)
[1] 863.5387
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.33421 73.19640 70.88211 69.01454 72.34874 70.42227 73.73694 71.28231
[9] 73.03688 71.87563
> rowSums(tmp5)
[1] 1806.684 1463.928 1417.642 1380.291 1446.975 1408.445 1474.739 1425.646
[9] 1460.738 1437.513
> rowVars(tmp5)
[1] 7991.68809 56.38599 105.94015 32.90203 71.89817 91.49909
[7] 68.55694 115.66688 66.96103 96.66719
> rowSd(tmp5)
[1] 89.396242 7.509060 10.292723 5.736029 8.479279 9.565516 8.279912
[8] 10.754854 8.182972 9.831947
> rowMax(tmp5)
[1] 469.42075 88.66018 90.32858 80.45349 90.29229 90.75424 87.03333
[8] 89.88701 86.60049 90.72725
> rowMin(tmp5)
[1] 60.38368 59.34433 56.62502 53.68956 56.97056 55.06275 59.38645 55.75651
[9] 59.80731 60.64929
>
> colMeans(tmp5)
[1] 108.52053 67.44783 67.92617 69.00100 72.10750 71.09042 71.41385
[8] 72.04292 67.64076 74.86374 76.58742 76.65265 77.01843 71.02951
[15] 69.35947 74.17466 70.05420 72.59896 68.49627 74.23376
> colSums(tmp5)
[1] 1085.2053 674.4783 679.2617 690.0100 721.0750 710.9042 714.1385
[8] 720.4292 676.4076 748.6374 765.8742 766.5265 770.1843 710.2951
[15] 693.5947 741.7466 700.5420 725.9896 684.9627 742.3376
> colVars(tmp5)
[1] 16119.82493 57.83102 74.90468 36.80099 70.33346 62.88505
[7] 60.17641 64.46368 86.47133 61.65777 61.07126 76.43145
[13] 95.93110 117.35500 64.32477 81.66027 37.24319 33.90855
[19] 95.61530 114.52706
> colSd(tmp5)
[1] 126.963873 7.604671 8.654749 6.066382 8.386504 7.930009
[7] 7.757346 8.028928 9.298996 7.852246 7.814811 8.742508
[13] 9.794442 10.833051 8.020272 9.036607 6.102720 5.823105
[19] 9.778308 10.701732
> colMax(tmp5)
[1] 469.42075 75.80453 84.69321 76.79299 86.43346 84.99961 85.18018
[8] 88.95058 85.24296 86.49866 90.32858 89.88701 90.29229 88.44034
[15] 80.45349 90.72725 76.87609 80.69670 86.60049 90.75424
> colMin(tmp5)
[1] 58.46940 55.75651 55.33469 59.38645 56.62502 60.84708 58.47618 62.69043
[9] 53.68956 66.60319 64.42033 66.43395 62.47396 55.06275 60.03058 59.34433
[17] 60.08859 62.67416 60.34461 60.64929
>
>
> ### 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] 90.33421 73.19640 70.88211 69.01454 72.34874 70.42227 73.73694 71.28231
[9] 73.03688 NA
> rowSums(tmp5)
[1] 1806.684 1463.928 1417.642 1380.291 1446.975 1408.445 1474.739 1425.646
[9] 1460.738 NA
> rowVars(tmp5)
[1] 7991.68809 56.38599 105.94015 32.90203 71.89817 91.49909
[7] 68.55694 115.66688 66.96103 101.80424
> rowSd(tmp5)
[1] 89.396242 7.509060 10.292723 5.736029 8.479279 9.565516 8.279912
[8] 10.754854 8.182972 10.089809
> rowMax(tmp5)
[1] 469.42075 88.66018 90.32858 80.45349 90.29229 90.75424 87.03333
[8] 89.88701 86.60049 NA
> rowMin(tmp5)
[1] 60.38368 59.34433 56.62502 53.68956 56.97056 55.06275 59.38645 55.75651
[9] 59.80731 NA
>
> colMeans(tmp5)
[1] 108.52053 67.44783 67.92617 69.00100 72.10750 71.09042 71.41385
[8] NA 67.64076 74.86374 76.58742 76.65265 77.01843 71.02951
[15] 69.35947 74.17466 70.05420 72.59896 68.49627 74.23376
> colSums(tmp5)
[1] 1085.2053 674.4783 679.2617 690.0100 721.0750 710.9042 714.1385
[8] NA 676.4076 748.6374 765.8742 766.5265 770.1843 710.2951
[15] 693.5947 741.7466 700.5420 725.9896 684.9627 742.3376
> colVars(tmp5)
[1] 16119.82493 57.83102 74.90468 36.80099 70.33346 62.88505
[7] 60.17641 NA 86.47133 61.65777 61.07126 76.43145
[13] 95.93110 117.35500 64.32477 81.66027 37.24319 33.90855
[19] 95.61530 114.52706
> colSd(tmp5)
[1] 126.963873 7.604671 8.654749 6.066382 8.386504 7.930009
[7] 7.757346 NA 9.298996 7.852246 7.814811 8.742508
[13] 9.794442 10.833051 8.020272 9.036607 6.102720 5.823105
[19] 9.778308 10.701732
> colMax(tmp5)
[1] 469.42075 75.80453 84.69321 76.79299 86.43346 84.99961 85.18018
[8] NA 85.24296 86.49866 90.32858 89.88701 90.29229 88.44034
[15] 80.45349 90.72725 76.87609 80.69670 86.60049 90.75424
> colMin(tmp5)
[1] 58.46940 55.75651 55.33469 59.38645 56.62502 60.84708 58.47618 NA
[9] 53.68956 66.60319 64.42033 66.43395 62.47396 55.06275 60.03058 59.34433
[17] 60.08859 62.67416 60.34461 60.64929
>
> Max(tmp5,na.rm=TRUE)
[1] 469.4208
> Min(tmp5,na.rm=TRUE)
[1] 53.68956
> mean(tmp5,na.rm=TRUE)
[1] 73.6117
> Sum(tmp5,na.rm=TRUE)
[1] 14648.73
> Var(tmp5,na.rm=TRUE)
[1] 867.8997
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.33421 73.19640 70.88211 69.01454 72.34874 70.42227 73.73694 71.28231
[9] 73.03688 71.77049
> rowSums(tmp5,na.rm=TRUE)
[1] 1806.684 1463.928 1417.642 1380.291 1446.975 1408.445 1474.739 1425.646
[9] 1460.738 1363.639
> rowVars(tmp5,na.rm=TRUE)
[1] 7991.68809 56.38599 105.94015 32.90203 71.89817 91.49909
[7] 68.55694 115.66688 66.96103 101.80424
> rowSd(tmp5,na.rm=TRUE)
[1] 89.396242 7.509060 10.292723 5.736029 8.479279 9.565516 8.279912
[8] 10.754854 8.182972 10.089809
> rowMax(tmp5,na.rm=TRUE)
[1] 469.42075 88.66018 90.32858 80.45349 90.29229 90.75424 87.03333
[8] 89.88701 86.60049 90.72725
> rowMin(tmp5,na.rm=TRUE)
[1] 60.38368 59.34433 56.62502 53.68956 56.97056 55.06275 59.38645 55.75651
[9] 59.80731 60.64929
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.52053 67.44783 67.92617 69.00100 72.10750 71.09042 71.41385
[8] 71.83956 67.64076 74.86374 76.58742 76.65265 77.01843 71.02951
[15] 69.35947 74.17466 70.05420 72.59896 68.49627 74.23376
> colSums(tmp5,na.rm=TRUE)
[1] 1085.2053 674.4783 679.2617 690.0100 721.0750 710.9042 714.1385
[8] 646.5560 676.4076 748.6374 765.8742 766.5265 770.1843 710.2951
[15] 693.5947 741.7466 700.5420 725.9896 684.9627 742.3376
> colVars(tmp5,na.rm=TRUE)
[1] 16119.82493 57.83102 74.90468 36.80099 70.33346 62.88505
[7] 60.17641 72.05638 86.47133 61.65777 61.07126 76.43145
[13] 95.93110 117.35500 64.32477 81.66027 37.24319 33.90855
[19] 95.61530 114.52706
> colSd(tmp5,na.rm=TRUE)
[1] 126.963873 7.604671 8.654749 6.066382 8.386504 7.930009
[7] 7.757346 8.488603 9.298996 7.852246 7.814811 8.742508
[13] 9.794442 10.833051 8.020272 9.036607 6.102720 5.823105
[19] 9.778308 10.701732
> colMax(tmp5,na.rm=TRUE)
[1] 469.42075 75.80453 84.69321 76.79299 86.43346 84.99961 85.18018
[8] 88.95058 85.24296 86.49866 90.32858 89.88701 90.29229 88.44034
[15] 80.45349 90.72725 76.87609 80.69670 86.60049 90.75424
> colMin(tmp5,na.rm=TRUE)
[1] 58.46940 55.75651 55.33469 59.38645 56.62502 60.84708 58.47618 62.69043
[9] 53.68956 66.60319 64.42033 66.43395 62.47396 55.06275 60.03058 59.34433
[17] 60.08859 62.67416 60.34461 60.64929
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.33421 73.19640 70.88211 69.01454 72.34874 70.42227 73.73694 71.28231
[9] 73.03688 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1806.684 1463.928 1417.642 1380.291 1446.975 1408.445 1474.739 1425.646
[9] 1460.738 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7991.68809 56.38599 105.94015 32.90203 71.89817 91.49909
[7] 68.55694 115.66688 66.96103 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 89.396242 7.509060 10.292723 5.736029 8.479279 9.565516 8.279912
[8] 10.754854 8.182972 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 469.42075 88.66018 90.32858 80.45349 90.29229 90.75424 87.03333
[8] 89.88701 86.60049 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 60.38368 59.34433 56.62502 53.68956 56.97056 55.06275 59.38645 55.75651
[9] 59.80731 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.32233 68.17726 68.46755 69.00459 72.41576 72.22857 70.65420
[8] NaN 68.26848 73.57097 75.62551 77.63973 78.63448 69.09497
[15] 68.74044 72.33548 69.53425 72.69613 69.12748 75.74314
> colSums(tmp5,na.rm=TRUE)
[1] 1010.9009 613.5953 616.2079 621.0413 651.7418 650.0571 635.8878
[8] 0.0000 614.4163 662.1387 680.6296 698.7576 707.7104 621.8548
[15] 618.6640 651.0194 625.8082 654.2652 622.1473 681.6883
> colVars(tmp5,na.rm=TRUE)
[1] 17972.19976 59.07418 80.97046 41.40097 78.05615 56.17263
[7] 61.20645 NA 92.84739 50.56341 58.29572 75.02411
[13] 78.54172 89.92202 68.05449 53.81388 38.85717 38.04089
[19] 103.08486 103.21268
> colSd(tmp5,na.rm=TRUE)
[1] 134.060433 7.685973 8.998359 6.434359 8.834939 7.494840
[7] 7.823455 NA 9.635735 7.110795 7.635164 8.661646
[13] 8.862377 9.482722 8.249515 7.335795 6.233552 6.167730
[19] 10.153072 10.159364
> colMax(tmp5,na.rm=TRUE)
[1] 469.42075 75.80453 84.69321 76.79299 86.43346 84.99961 85.18018
[8] -Inf 85.24296 85.03247 90.32858 89.88701 90.29229 79.65564
[15] 80.45349 85.38081 76.87609 80.69670 86.60049 90.75424
> colMin(tmp5,na.rm=TRUE)
[1] 58.46940 55.75651 55.33469 59.38645 56.62502 61.31709 58.47618 Inf
[9] 53.68956 66.60319 64.42033 66.43395 63.05258 55.06275 60.03058 59.34433
[17] 60.08859 62.67416 60.34461 64.23713
>
>
>
>
> 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] 229.7607 231.8762 254.0543 240.5510 204.7235 242.3020 112.2785 230.4835
[9] 157.7180 290.5807
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 229.7607 231.8762 254.0543 240.5510 204.7235 242.3020 112.2785 230.4835
[9] 157.7180 290.5807
>
>
>
> 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] 9.947598e-14 -5.684342e-14 -1.847411e-13 0.000000e+00 -2.273737e-13
[6] 0.000000e+00 7.105427e-14 -3.410605e-13 -1.136868e-13 -2.842171e-14
[11] -2.842171e-14 0.000000e+00 -1.989520e-13 0.000000e+00 -1.278977e-13
[16] -8.526513e-14 0.000000e+00 0.000000e+00 1.989520e-13 -8.526513e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 7
6 14
9 18
1 10
1 3
6 6
8 2
4 11
9 7
3 9
10 15
4 20
3 9
8 11
10 5
3 15
8 10
8 4
10 14
3 14
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.233277
> Min(tmp)
[1] -2.48309
> mean(tmp)
[1] -0.1302681
> Sum(tmp)
[1] -13.02681
> Var(tmp)
[1] 0.800516
>
> rowMeans(tmp)
[1] -0.1302681
> rowSums(tmp)
[1] -13.02681
> rowVars(tmp)
[1] 0.800516
> rowSd(tmp)
[1] 0.8947156
> rowMax(tmp)
[1] 2.233277
> rowMin(tmp)
[1] -2.48309
>
> colMeans(tmp)
[1] -0.50523398 -0.06185980 -0.52764660 0.51760799 -1.29552942 -1.15058524
[7] 2.02683497 -2.26868078 -0.97646311 -2.48309000 -1.36129365 0.91627207
[13] -0.08442343 -2.03065590 -0.93708384 -0.59665324 -0.52777647 -1.16525172
[19] 0.09299794 0.12221716 0.16051750 -0.35711211 -0.70636344 0.66543093
[25] -0.07166303 -0.02636579 0.01455836 0.47175152 0.35630512 -0.13905108
[31] -0.13057432 -0.62595263 1.10526631 0.33782743 0.58982943 1.27430564
[37] -2.20759407 2.23327733 -0.32796565 0.15613240 0.42716156 -0.85812488
[43] 0.84594890 -0.58276068 -0.71735404 -0.48489258 0.30834794 -0.35087502
[49] -0.98881849 0.62208364 -0.42655864 0.45227004 0.04115322 1.79268366
[55] -0.15418560 0.58964265 -0.37945092 0.13799215 -0.11249397 -0.19955996
[61] 0.51973176 0.63602457 -0.19870561 0.36705943 0.43316970 0.70498965
[67] 1.62233037 0.54331975 -1.64517910 0.48491034 -0.54623400 0.37178494
[73] -0.24973905 0.58585824 -0.03835523 0.69118072 0.77447665 -1.12558076
[79] -1.19629491 -0.56160856 -0.51751161 -1.04965876 0.53867440 -0.78459570
[85] 0.09407125 -1.47421071 -0.37105165 0.03586108 -0.04223407 0.68283197
[91] -1.28212905 -1.22572481 -0.29811725 1.31897716 0.90521579 0.66822286
[97] 0.35653396 -1.36214881 -1.10539120 -0.72603128
> colSums(tmp)
[1] -0.50523398 -0.06185980 -0.52764660 0.51760799 -1.29552942 -1.15058524
[7] 2.02683497 -2.26868078 -0.97646311 -2.48309000 -1.36129365 0.91627207
[13] -0.08442343 -2.03065590 -0.93708384 -0.59665324 -0.52777647 -1.16525172
[19] 0.09299794 0.12221716 0.16051750 -0.35711211 -0.70636344 0.66543093
[25] -0.07166303 -0.02636579 0.01455836 0.47175152 0.35630512 -0.13905108
[31] -0.13057432 -0.62595263 1.10526631 0.33782743 0.58982943 1.27430564
[37] -2.20759407 2.23327733 -0.32796565 0.15613240 0.42716156 -0.85812488
[43] 0.84594890 -0.58276068 -0.71735404 -0.48489258 0.30834794 -0.35087502
[49] -0.98881849 0.62208364 -0.42655864 0.45227004 0.04115322 1.79268366
[55] -0.15418560 0.58964265 -0.37945092 0.13799215 -0.11249397 -0.19955996
[61] 0.51973176 0.63602457 -0.19870561 0.36705943 0.43316970 0.70498965
[67] 1.62233037 0.54331975 -1.64517910 0.48491034 -0.54623400 0.37178494
[73] -0.24973905 0.58585824 -0.03835523 0.69118072 0.77447665 -1.12558076
[79] -1.19629491 -0.56160856 -0.51751161 -1.04965876 0.53867440 -0.78459570
[85] 0.09407125 -1.47421071 -0.37105165 0.03586108 -0.04223407 0.68283197
[91] -1.28212905 -1.22572481 -0.29811725 1.31897716 0.90521579 0.66822286
[97] 0.35653396 -1.36214881 -1.10539120 -0.72603128
> 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.50523398 -0.06185980 -0.52764660 0.51760799 -1.29552942 -1.15058524
[7] 2.02683497 -2.26868078 -0.97646311 -2.48309000 -1.36129365 0.91627207
[13] -0.08442343 -2.03065590 -0.93708384 -0.59665324 -0.52777647 -1.16525172
[19] 0.09299794 0.12221716 0.16051750 -0.35711211 -0.70636344 0.66543093
[25] -0.07166303 -0.02636579 0.01455836 0.47175152 0.35630512 -0.13905108
[31] -0.13057432 -0.62595263 1.10526631 0.33782743 0.58982943 1.27430564
[37] -2.20759407 2.23327733 -0.32796565 0.15613240 0.42716156 -0.85812488
[43] 0.84594890 -0.58276068 -0.71735404 -0.48489258 0.30834794 -0.35087502
[49] -0.98881849 0.62208364 -0.42655864 0.45227004 0.04115322 1.79268366
[55] -0.15418560 0.58964265 -0.37945092 0.13799215 -0.11249397 -0.19955996
[61] 0.51973176 0.63602457 -0.19870561 0.36705943 0.43316970 0.70498965
[67] 1.62233037 0.54331975 -1.64517910 0.48491034 -0.54623400 0.37178494
[73] -0.24973905 0.58585824 -0.03835523 0.69118072 0.77447665 -1.12558076
[79] -1.19629491 -0.56160856 -0.51751161 -1.04965876 0.53867440 -0.78459570
[85] 0.09407125 -1.47421071 -0.37105165 0.03586108 -0.04223407 0.68283197
[91] -1.28212905 -1.22572481 -0.29811725 1.31897716 0.90521579 0.66822286
[97] 0.35653396 -1.36214881 -1.10539120 -0.72603128
> colMin(tmp)
[1] -0.50523398 -0.06185980 -0.52764660 0.51760799 -1.29552942 -1.15058524
[7] 2.02683497 -2.26868078 -0.97646311 -2.48309000 -1.36129365 0.91627207
[13] -0.08442343 -2.03065590 -0.93708384 -0.59665324 -0.52777647 -1.16525172
[19] 0.09299794 0.12221716 0.16051750 -0.35711211 -0.70636344 0.66543093
[25] -0.07166303 -0.02636579 0.01455836 0.47175152 0.35630512 -0.13905108
[31] -0.13057432 -0.62595263 1.10526631 0.33782743 0.58982943 1.27430564
[37] -2.20759407 2.23327733 -0.32796565 0.15613240 0.42716156 -0.85812488
[43] 0.84594890 -0.58276068 -0.71735404 -0.48489258 0.30834794 -0.35087502
[49] -0.98881849 0.62208364 -0.42655864 0.45227004 0.04115322 1.79268366
[55] -0.15418560 0.58964265 -0.37945092 0.13799215 -0.11249397 -0.19955996
[61] 0.51973176 0.63602457 -0.19870561 0.36705943 0.43316970 0.70498965
[67] 1.62233037 0.54331975 -1.64517910 0.48491034 -0.54623400 0.37178494
[73] -0.24973905 0.58585824 -0.03835523 0.69118072 0.77447665 -1.12558076
[79] -1.19629491 -0.56160856 -0.51751161 -1.04965876 0.53867440 -0.78459570
[85] 0.09407125 -1.47421071 -0.37105165 0.03586108 -0.04223407 0.68283197
[91] -1.28212905 -1.22572481 -0.29811725 1.31897716 0.90521579 0.66822286
[97] 0.35653396 -1.36214881 -1.10539120 -0.72603128
> colMedians(tmp)
[1] -0.50523398 -0.06185980 -0.52764660 0.51760799 -1.29552942 -1.15058524
[7] 2.02683497 -2.26868078 -0.97646311 -2.48309000 -1.36129365 0.91627207
[13] -0.08442343 -2.03065590 -0.93708384 -0.59665324 -0.52777647 -1.16525172
[19] 0.09299794 0.12221716 0.16051750 -0.35711211 -0.70636344 0.66543093
[25] -0.07166303 -0.02636579 0.01455836 0.47175152 0.35630512 -0.13905108
[31] -0.13057432 -0.62595263 1.10526631 0.33782743 0.58982943 1.27430564
[37] -2.20759407 2.23327733 -0.32796565 0.15613240 0.42716156 -0.85812488
[43] 0.84594890 -0.58276068 -0.71735404 -0.48489258 0.30834794 -0.35087502
[49] -0.98881849 0.62208364 -0.42655864 0.45227004 0.04115322 1.79268366
[55] -0.15418560 0.58964265 -0.37945092 0.13799215 -0.11249397 -0.19955996
[61] 0.51973176 0.63602457 -0.19870561 0.36705943 0.43316970 0.70498965
[67] 1.62233037 0.54331975 -1.64517910 0.48491034 -0.54623400 0.37178494
[73] -0.24973905 0.58585824 -0.03835523 0.69118072 0.77447665 -1.12558076
[79] -1.19629491 -0.56160856 -0.51751161 -1.04965876 0.53867440 -0.78459570
[85] 0.09407125 -1.47421071 -0.37105165 0.03586108 -0.04223407 0.68283197
[91] -1.28212905 -1.22572481 -0.29811725 1.31897716 0.90521579 0.66822286
[97] 0.35653396 -1.36214881 -1.10539120 -0.72603128
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.505234 -0.0618598 -0.5276466 0.517608 -1.295529 -1.150585 2.026835
[2,] -0.505234 -0.0618598 -0.5276466 0.517608 -1.295529 -1.150585 2.026835
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -2.268681 -0.9764631 -2.48309 -1.361294 0.9162721 -0.08442343 -2.030656
[2,] -2.268681 -0.9764631 -2.48309 -1.361294 0.9162721 -0.08442343 -2.030656
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.9370838 -0.5966532 -0.5277765 -1.165252 0.09299794 0.1222172 0.1605175
[2,] -0.9370838 -0.5966532 -0.5277765 -1.165252 0.09299794 0.1222172 0.1605175
[,22] [,23] [,24] [,25] [,26] [,27]
[1,] -0.3571121 -0.7063634 0.6654309 -0.07166303 -0.02636579 0.01455836
[2,] -0.3571121 -0.7063634 0.6654309 -0.07166303 -0.02636579 0.01455836
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] 0.4717515 0.3563051 -0.1390511 -0.1305743 -0.6259526 1.105266 0.3378274
[2,] 0.4717515 0.3563051 -0.1390511 -0.1305743 -0.6259526 1.105266 0.3378274
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] 0.5898294 1.274306 -2.207594 2.233277 -0.3279656 0.1561324 0.4271616
[2,] 0.5898294 1.274306 -2.207594 2.233277 -0.3279656 0.1561324 0.4271616
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.8581249 0.8459489 -0.5827607 -0.717354 -0.4848926 0.3083479 -0.350875
[2,] -0.8581249 0.8459489 -0.5827607 -0.717354 -0.4848926 0.3083479 -0.350875
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.9888185 0.6220836 -0.4265586 0.45227 0.04115322 1.792684 -0.1541856
[2,] -0.9888185 0.6220836 -0.4265586 0.45227 0.04115322 1.792684 -0.1541856
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.5896426 -0.3794509 0.1379922 -0.112494 -0.19956 0.5197318 0.6360246
[2,] 0.5896426 -0.3794509 0.1379922 -0.112494 -0.19956 0.5197318 0.6360246
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.1987056 0.3670594 0.4331697 0.7049897 1.62233 0.5433197 -1.645179
[2,] -0.1987056 0.3670594 0.4331697 0.7049897 1.62233 0.5433197 -1.645179
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.4849103 -0.546234 0.3717849 -0.2497391 0.5858582 -0.03835523 0.6911807
[2,] 0.4849103 -0.546234 0.3717849 -0.2497391 0.5858582 -0.03835523 0.6911807
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.7744767 -1.125581 -1.196295 -0.5616086 -0.5175116 -1.049659 0.5386744
[2,] 0.7744767 -1.125581 -1.196295 -0.5616086 -0.5175116 -1.049659 0.5386744
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -0.7845957 0.09407125 -1.474211 -0.3710516 0.03586108 -0.04223407 0.682832
[2,] -0.7845957 0.09407125 -1.474211 -0.3710516 0.03586108 -0.04223407 0.682832
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] -1.282129 -1.225725 -0.2981173 1.318977 0.9052158 0.6682229 0.356534
[2,] -1.282129 -1.225725 -0.2981173 1.318977 0.9052158 0.6682229 0.356534
[,98] [,99] [,100]
[1,] -1.362149 -1.105391 -0.7260313
[2,] -1.362149 -1.105391 -0.7260313
>
>
> Max(tmp2)
[1] 2.143469
> Min(tmp2)
[1] -2.546387
> mean(tmp2)
[1] -0.1768504
> Sum(tmp2)
[1] -17.68504
> Var(tmp2)
[1] 0.7751991
>
> rowMeans(tmp2)
[1] -0.393673400 0.354099977 0.779155468 0.813629389 -0.193382000
[6] -0.253059487 -0.371684320 0.820039085 -0.108132716 -0.243715599
[11] -0.439853707 -0.967599701 -0.044617465 -0.676098933 0.395754034
[16] -0.409633674 -0.193200411 -0.543369045 -1.925056272 -0.726595808
[21] 0.427508163 -0.771089310 -2.546386753 -0.673257640 1.645458689
[26] -0.723706440 -1.665227896 0.337411622 -0.221197653 -0.399393509
[31] -0.132845052 -0.902437089 -2.430393552 0.339403686 0.274753063
[36] 1.142971352 -0.742501680 1.013018935 -0.187140201 0.036140023
[41] 0.452159100 1.256268818 -1.859874344 0.027000856 -0.108189255
[46] -1.230326045 -0.214726276 0.203937899 -0.410310285 -1.300073151
[51] -2.001663359 -0.019378084 0.089537333 -0.154468600 0.626202078
[56] -0.491949274 0.110256653 -0.903793031 0.035673520 -0.002129736
[61] 0.418724003 -1.037592604 0.860669454 0.458660218 0.141043397
[66] 0.802109641 -1.023105574 -1.404388670 0.911671804 -0.025111236
[71] 0.878672107 2.143469451 0.320616985 -0.011033244 -1.142301003
[76] -0.269747861 -1.159857221 -0.710734676 -0.026912450 0.997991054
[81] -2.195059229 -1.446801913 0.008536398 -0.563543045 -0.078549720
[86] 0.121793619 0.058602383 -0.732366161 -0.238946773 -0.837704077
[91] -0.061897374 -0.072680335 0.657631138 -1.092029607 -0.866613971
[96] 0.970942466 1.461469064 1.207296790 0.518071861 0.775715771
> rowSums(tmp2)
[1] -0.393673400 0.354099977 0.779155468 0.813629389 -0.193382000
[6] -0.253059487 -0.371684320 0.820039085 -0.108132716 -0.243715599
[11] -0.439853707 -0.967599701 -0.044617465 -0.676098933 0.395754034
[16] -0.409633674 -0.193200411 -0.543369045 -1.925056272 -0.726595808
[21] 0.427508163 -0.771089310 -2.546386753 -0.673257640 1.645458689
[26] -0.723706440 -1.665227896 0.337411622 -0.221197653 -0.399393509
[31] -0.132845052 -0.902437089 -2.430393552 0.339403686 0.274753063
[36] 1.142971352 -0.742501680 1.013018935 -0.187140201 0.036140023
[41] 0.452159100 1.256268818 -1.859874344 0.027000856 -0.108189255
[46] -1.230326045 -0.214726276 0.203937899 -0.410310285 -1.300073151
[51] -2.001663359 -0.019378084 0.089537333 -0.154468600 0.626202078
[56] -0.491949274 0.110256653 -0.903793031 0.035673520 -0.002129736
[61] 0.418724003 -1.037592604 0.860669454 0.458660218 0.141043397
[66] 0.802109641 -1.023105574 -1.404388670 0.911671804 -0.025111236
[71] 0.878672107 2.143469451 0.320616985 -0.011033244 -1.142301003
[76] -0.269747861 -1.159857221 -0.710734676 -0.026912450 0.997991054
[81] -2.195059229 -1.446801913 0.008536398 -0.563543045 -0.078549720
[86] 0.121793619 0.058602383 -0.732366161 -0.238946773 -0.837704077
[91] -0.061897374 -0.072680335 0.657631138 -1.092029607 -0.866613971
[96] 0.970942466 1.461469064 1.207296790 0.518071861 0.775715771
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.393673400 0.354099977 0.779155468 0.813629389 -0.193382000
[6] -0.253059487 -0.371684320 0.820039085 -0.108132716 -0.243715599
[11] -0.439853707 -0.967599701 -0.044617465 -0.676098933 0.395754034
[16] -0.409633674 -0.193200411 -0.543369045 -1.925056272 -0.726595808
[21] 0.427508163 -0.771089310 -2.546386753 -0.673257640 1.645458689
[26] -0.723706440 -1.665227896 0.337411622 -0.221197653 -0.399393509
[31] -0.132845052 -0.902437089 -2.430393552 0.339403686 0.274753063
[36] 1.142971352 -0.742501680 1.013018935 -0.187140201 0.036140023
[41] 0.452159100 1.256268818 -1.859874344 0.027000856 -0.108189255
[46] -1.230326045 -0.214726276 0.203937899 -0.410310285 -1.300073151
[51] -2.001663359 -0.019378084 0.089537333 -0.154468600 0.626202078
[56] -0.491949274 0.110256653 -0.903793031 0.035673520 -0.002129736
[61] 0.418724003 -1.037592604 0.860669454 0.458660218 0.141043397
[66] 0.802109641 -1.023105574 -1.404388670 0.911671804 -0.025111236
[71] 0.878672107 2.143469451 0.320616985 -0.011033244 -1.142301003
[76] -0.269747861 -1.159857221 -0.710734676 -0.026912450 0.997991054
[81] -2.195059229 -1.446801913 0.008536398 -0.563543045 -0.078549720
[86] 0.121793619 0.058602383 -0.732366161 -0.238946773 -0.837704077
[91] -0.061897374 -0.072680335 0.657631138 -1.092029607 -0.866613971
[96] 0.970942466 1.461469064 1.207296790 0.518071861 0.775715771
> rowMin(tmp2)
[1] -0.393673400 0.354099977 0.779155468 0.813629389 -0.193382000
[6] -0.253059487 -0.371684320 0.820039085 -0.108132716 -0.243715599
[11] -0.439853707 -0.967599701 -0.044617465 -0.676098933 0.395754034
[16] -0.409633674 -0.193200411 -0.543369045 -1.925056272 -0.726595808
[21] 0.427508163 -0.771089310 -2.546386753 -0.673257640 1.645458689
[26] -0.723706440 -1.665227896 0.337411622 -0.221197653 -0.399393509
[31] -0.132845052 -0.902437089 -2.430393552 0.339403686 0.274753063
[36] 1.142971352 -0.742501680 1.013018935 -0.187140201 0.036140023
[41] 0.452159100 1.256268818 -1.859874344 0.027000856 -0.108189255
[46] -1.230326045 -0.214726276 0.203937899 -0.410310285 -1.300073151
[51] -2.001663359 -0.019378084 0.089537333 -0.154468600 0.626202078
[56] -0.491949274 0.110256653 -0.903793031 0.035673520 -0.002129736
[61] 0.418724003 -1.037592604 0.860669454 0.458660218 0.141043397
[66] 0.802109641 -1.023105574 -1.404388670 0.911671804 -0.025111236
[71] 0.878672107 2.143469451 0.320616985 -0.011033244 -1.142301003
[76] -0.269747861 -1.159857221 -0.710734676 -0.026912450 0.997991054
[81] -2.195059229 -1.446801913 0.008536398 -0.563543045 -0.078549720
[86] 0.121793619 0.058602383 -0.732366161 -0.238946773 -0.837704077
[91] -0.061897374 -0.072680335 0.657631138 -1.092029607 -0.866613971
[96] 0.970942466 1.461469064 1.207296790 0.518071861 0.775715771
>
> colMeans(tmp2)
[1] -0.1768504
> colSums(tmp2)
[1] -17.68504
> colVars(tmp2)
[1] 0.7751991
> colSd(tmp2)
[1] 0.8804539
> colMax(tmp2)
[1] 2.143469
> colMin(tmp2)
[1] -2.546387
> colMedians(tmp2)
[1] -0.108161
> colRanges(tmp2)
[,1]
[1,] -2.546387
[2,] 2.143469
>
> 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.8645538 -2.2378979 3.6817375 4.1055855 -2.6016060 -0.7109328
[7] -0.4026424 3.1474935 -0.3191801 0.6099834
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7397469
[2,] -0.1504023
[3,] 0.2245397
[4,] 0.6531292
[5,] 0.9177382
>
> rowApply(tmp,sum)
[1] 0.21201724 -1.43183415 1.72000962 4.60956721 -0.31458837 0.08258689
[7] -0.03394880 2.38777040 0.18192894 -0.27641445
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 7 5 6 5 6 7 1 9 8
[2,] 6 2 1 4 6 5 9 7 1 7
[3,] 5 4 7 3 9 10 4 10 6 3
[4,] 7 6 9 5 4 1 2 8 10 10
[5,] 10 5 8 1 1 2 3 9 2 4
[6,] 2 8 4 7 3 3 10 6 5 1
[7,] 1 9 10 2 10 4 6 5 3 2
[8,] 3 10 6 9 8 8 1 4 7 6
[9,] 9 1 2 10 7 9 5 2 4 5
[10,] 4 3 3 8 2 7 8 3 8 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.60003811 1.26462778 3.99789744 1.08910844 1.20143290 -1.39690196
[7] -2.27033393 -1.25395319 -1.74910751 2.12227321 5.75831225 0.55363125
[13] 3.77576551 -0.47608228 -2.04229428 -0.23563569 -0.13833407 -2.73053168
[19] -0.03863723 0.41562026
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.72755103
[2,] -0.41357936
[3,] -0.27312287
[4,] -0.16990424
[5,] -0.01588062
>
> rowApply(tmp,sum)
[1] -1.024652 6.818743 5.910837 -3.559696 -1.898414
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 8 7 7 11
[2,] 3 7 19 9 16
[3,] 13 17 17 10 14
[4,] 6 19 10 17 12
[5,] 18 11 15 3 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.72755103 -1.54984309 0.5783318 -1.15802927 1.4275606 0.9367907
[2,] -0.01588062 -0.01921142 1.3679188 1.81324603 0.2938682 -0.2824974
[3,] -0.16990424 1.86757953 1.5261461 0.05560647 1.1434702 -1.0825074
[4,] -0.41357936 -0.06984883 0.1222494 0.43112488 -1.1879725 0.1440619
[5,] -0.27312287 1.03595160 0.4032513 -0.05283968 -0.4754936 -1.1127498
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] -1.7868099 0.6559705 -0.7043625 1.8382403 1.463320 0.4104315 0.4667684
[2,] 0.3878718 -1.0863883 0.4630559 0.7678265 1.374445 2.5848248 1.3355513
[3,] 0.5844002 0.2383113 -1.1158447 1.6122887 2.540337 1.3072254 0.1595769
[4,] -1.1091462 0.2884442 -0.7038145 -1.0340002 -1.276032 -2.4674397 0.2720911
[5,] -0.3466498 -1.3502910 0.3118584 -1.0620820 1.656243 -1.2814109 1.5417778
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] -1.6810993 1.3749516 0.9675743 -0.8995582 -1.43170960 -1.44018737
[2,] -0.1568694 -1.5078489 -1.1046527 -0.8204195 0.02425791 1.26011416
[3,] -0.4945418 -1.8034645 -0.3028923 0.1836457 0.01603782 -0.02713069
[4,] 0.3672379 0.3924427 0.9468971 0.2080154 0.57571461 1.29843800
[5,] 1.4891904 -0.4983752 -0.7425621 1.1899826 -1.91483242 -1.12987132
[,20]
[1,] 0.2345591
[2,] 0.1395306
[3,] -0.3275020
[4,] -0.3445799
[5,] 0.7136125
>
>
> 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 : 655 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 : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.5342241 0.03935001 0.6837258 1.554852 1.573705 0.1930929 -0.3076771
col8 col9 col10 col11 col12 col13 col14
row1 0.3944645 -1.22658 -0.1211373 1.155916 -1.306383 1.297031 -0.276448
col15 col16 col17 col18 col19 col20
row1 0.6909624 -2.275009 0.3761601 -0.8861552 -0.8146981 0.8611467
> tmp[,"col10"]
col10
row1 -0.1211373
row2 -0.4100368
row3 -1.7552995
row4 0.4466256
row5 -1.7320848
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.5342241 0.03935001 0.68372583 1.5548523 1.573705 0.1930929
row5 0.6132019 -1.85504802 -0.09893088 -0.2990981 1.495271 0.7900920
col7 col8 col9 col10 col11 col12 col13
row1 -0.30767707 0.3944645 -1.2265798 -0.1211373 1.1559164 -1.306383 1.297031
row5 0.04296351 -0.6252571 0.6994298 -1.7320848 0.3478247 -0.733978 2.252573
col14 col15 col16 col17 col18 col19 col20
row1 -0.2764480 0.6909624 -2.275009 0.3761601 -0.8861552 -0.8146981 0.86114674
row5 -0.4273855 0.9758318 -1.178682 -1.7216308 0.2400788 -0.2299013 0.08890943
> tmp[,c("col6","col20")]
col6 col20
row1 0.1930929 0.86114674
row2 -1.4053644 1.05385550
row3 -0.3540944 3.66488136
row4 -0.8177570 -0.99994285
row5 0.7900920 0.08890943
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.1930929 0.86114674
row5 0.7900920 0.08890943
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.1182 48.97706 49.06342 48.70775 49.84315 104.8504 50.95614 50.06347
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.7346 49.45747 50.76748 50.29145 49.58651 49.49387 49.96172 49.3566
col17 col18 col19 col20
row1 49.11571 49.1194 49.70462 103.1416
> tmp[,"col10"]
col10
row1 49.45747
row2 30.96740
row3 30.79980
row4 29.54107
row5 49.58168
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.11820 48.97706 49.06342 48.70775 49.84315 104.8504 50.95614 50.06347
row5 49.58797 49.13205 51.15323 49.64411 50.58152 106.0807 50.45646 50.68095
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.73460 49.45747 50.76748 50.29145 49.58651 49.49387 49.96172 49.35660
row5 50.16629 49.58168 48.55196 50.84603 48.88356 51.25879 52.43928 49.40618
col17 col18 col19 col20
row1 49.11571 49.11940 49.70462 103.1416
row5 49.50759 49.13867 48.94467 105.8454
> tmp[,c("col6","col20")]
col6 col20
row1 104.85036 103.14164
row2 75.26247 74.48884
row3 75.91649 74.91106
row4 74.66417 75.38806
row5 106.08069 105.84538
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.8504 103.1416
row5 106.0807 105.8454
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.8504 103.1416
row5 106.0807 105.8454
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.3912183
[2,] -1.3296648
[3,] 0.9280204
[4,] -1.1351709
[5,] -0.5046071
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.4720097 -1.0157434
[2,] -0.9696595 0.8443702
[3,] 0.9147018 -0.6243885
[4,] 0.9357541 -0.8095679
[5,] 2.2002390 1.0076173
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.32405367 -0.7879104
[2,] -0.13804577 -1.0248688
[3,] 0.20045412 -0.7455742
[4,] 1.87025613 -1.2035508
[5,] 0.09511551 1.0803342
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.324054
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.3240537
[2,] -0.1380458
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.8146749 0.6165216 -0.3062500 0.4671618 -0.5270889 0.3458948 1.1799230
row1 1.1197511 1.3029187 0.5971968 0.5416620 0.9916980 1.9579347 0.8534918
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -1.397620 -0.8533145 -0.9534896 -0.6072351 -0.5765692 -0.02140464
row1 -1.017076 0.2620545 0.4565790 0.4523289 0.4947270 1.27009038
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.041728 0.9393349 -0.1647912 -0.1821130 0.1060362 -0.8854622 0.47466315
row1 -1.119276 0.6266725 -1.2956116 0.6762486 0.8423965 -0.7337949 -0.07068744
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.9700695 -1.360267 -1.377912 -0.6008589 2.186961 -1.015291 0.3157012
[,8] [,9] [,10]
row2 -0.05405544 -0.5944286 0.02714376
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row5 -0.4715413 -0.6606894 -0.1213968 0.5446225 -0.5242732 -0.6318582
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row5 -0.9789339 0.9546954 0.8712417 0.5300678 1.109256 2.099041 1.049324
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3790869 2.022987 -0.1876242 0.2985329 -0.4703464 0.5935893 -0.4005289
>
>
> 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: 0xaffca0600>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e9770874f1"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e94c35b744"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e95a92f872"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e966f532d2"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e96bdbadcc"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e9236f6366"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e965e6cfb6"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e9144ee9fe"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e948e42d1c"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e97c4daea6"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e95005540b"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e9dd0c738"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e95c7349e"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e9594f7408"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM112e96f4ae706"
>
>
> ### 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: 0xaffca10e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xaffca10e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xaffca10e0>
> rowMedians(tmp)
[1] 0.1266503963 0.3713388419 -0.4504951885 0.2328812042 0.2204682352
[6] -0.0251683568 0.1612446409 -0.1835901274 0.2669211518 0.1092940199
[11] -0.1147719907 -0.1033994839 0.4300487060 0.0373339923 0.4558059298
[16] -0.0968577404 -0.0236076243 0.0976685497 0.0402385389 0.3533440352
[21] 0.4430180197 -0.0987083576 0.0179247673 0.0795682136 -0.4726764855
[26] -0.0720693579 -0.2638080780 -0.0458325876 0.3946554646 0.4206735899
[31] -0.4121091866 -0.1066423100 0.0765853556 -0.2821002147 -0.1345507982
[36] -0.3529717449 0.5575087492 -0.1168162977 -0.2842692624 0.0207521320
[41] 0.2228677678 -0.1557209270 0.0377149091 0.1912907823 -0.3103473898
[46] 0.6379658024 -0.3342950652 -0.0875033602 -0.5388040516 0.0646415096
[51] -0.0482771430 -0.2026941245 0.6175282535 -0.1204690685 -0.3046289018
[56] 0.3098648006 -0.1102042716 0.4024328341 -0.2809481914 0.3399620848
[61] -0.1968110862 -0.3228438445 0.0500225734 -0.0895466858 -0.2209657519
[66] -0.2697896018 -0.1083486346 0.3974880456 -0.2828715277 0.3479646647
[71] -0.2050565205 -0.0802195255 0.0661381451 -0.4313008414 -0.0825338401
[76] -0.0287854910 0.4436311856 0.4705893410 -0.5965139809 -0.4320880856
[81] -0.1586741825 0.4489052601 -0.0617736256 0.1515941776 -0.1351435926
[86] 0.0732835610 0.2221865268 -0.6119653552 -0.6251589454 -0.0727544336
[91] 0.3167631132 0.1721695076 -0.3005789436 0.0233841384 0.1316550345
[96] 0.1478940545 0.0426648941 0.1756203507 0.1666889996 -0.5432549196
[101] -0.3310608802 0.2979792513 -0.2766456913 -0.1559647184 0.7939924894
[106] -0.1663983038 -0.1768411065 -0.0618046516 0.1014386864 0.1265889631
[111] 0.1506867159 0.2588239936 0.3684883726 0.1075306120 -0.0684062735
[116] -0.5408036260 0.0502326253 0.2131363409 0.2113003626 -0.2310504836
[121] -0.2412994315 -0.5066362895 -0.0017659241 0.1191904836 -0.2371298944
[126] 0.1599602964 0.2810699470 -0.3373568343 0.0918707947 -0.2110242854
[131] 0.0111355448 0.0219120323 0.4671933822 0.2567979857 0.2989303033
[136] -0.4368432333 -0.1392965500 0.2183256878 0.4698892257 -0.0226549229
[141] -0.1153939863 -0.0376772463 -0.2123415916 -0.5722052018 0.1031153123
[146] 0.2557163402 -0.1353805366 -0.3443139815 0.1243222370 -0.7109158658
[151] -0.3392750428 0.2124364015 -0.0191644385 -0.0887540766 -0.0009762586
[156] -0.0963177009 -0.2845619523 0.0542820908 0.0632702724 0.1088167020
[161] -0.4390446125 0.1695774363 0.2147762041 0.6546897699 0.1980982356
[166] -0.0880834896 0.3661100614 -0.4351192870 -0.4653610367 0.0431448628
[171] 0.2194000959 -0.0879368529 0.0948716799 -0.1930769309 -0.3287994772
[176] -0.3250109296 -0.3050539767 -0.1596103338 -0.3244047323 0.2632505532
[181] -0.4394036923 0.1688959913 -0.4271872442 0.2698478847 -0.1627840549
[186] -0.2931217921 -0.1130772196 0.4759354517 -0.2664486782 -0.2508400444
[191] 0.3103415776 -0.4006137694 -0.0733951409 0.0181541808 0.4832743730
[196] 0.1311268323 0.7844592156 -0.3580121353 0.2747633023 0.4362401683
[201] -0.7215507916 0.0540945666 -0.3735022768 -0.0129796327 -0.0926344680
[206] -0.3706102747 0.1875738848 0.1929058736 0.2538461062 0.0132791178
[211] 0.1812744646 0.4106274845 0.1387443699 -0.5543905375 0.5205935091
[216] -0.0253029747 0.0917375850 0.1754818526 0.1265477006 0.0635806368
[221] -0.2071925137 -0.0993954553 -0.2627244995 -0.1527565441 0.0204788910
[226] -0.4299950215 -0.2884988393 0.0946084991 0.6757198320 0.4812844943
>
> proc.time()
user system elapsed
0.920 5.903 7.082
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
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: 0x105e0c500>
> .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: 0x105e0c500>
> .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: 0x105e0c500>
> .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: 0x105e0c500>
> 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: 0xc434a4540>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4540>
> .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: 0xc434a4540>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4540>
> .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: 0xc434a4540>
> 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: 0xc434a4720>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4720>
> .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: 0xc434a4720>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xc434a4720>
> .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: 0xc434a4720>
>
> .Call("R_bm_RowMode",P)
<pointer: 0xc434a4720>
> .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: 0xc434a4720>
>
> .Call("R_bm_ColMode",P)
<pointer: 0xc434a4720>
> .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: 0xc434a4720>
> 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: 0xc434a4900>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xc434a4900>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4900>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4900>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1153b1802dcaa" "BufferedMatrixFile1153b52350980"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1153b1802dcaa" "BufferedMatrixFile1153b52350980"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4ba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4ba0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xc434a4ba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xc434a4ba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xc434a4ba0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xc434a4ba0>
> .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: 0xc434a4d80>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc434a4d80>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xc434a4d80>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xc434a4d80>
> 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: 0xc434a4f60>
> .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: 0xc434a4f60>
> rm(P)
>
> proc.time()
user system elapsed
0.166 0.069 0.242
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
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.144 0.031 0.175