| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-10 11:35 -0400 (Fri, 10 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) | 4917 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences" | 4629 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 258/2388 | 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 | |||||||||
| 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-09 17:49:35 -0400 (Thu, 09 Apr 2026) |
| EndedAt: 2026-04-09 17:49:55 -0400 (Thu, 09 Apr 2026) |
| EllapsedTime: 20.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-26 r89717)
* 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-09 21:49:35 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu23 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu23 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
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.137 0.052 0.184
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 484129 25.9 1067215 57 NA 632020 33.8
Vcells 896948 6.9 8388608 64 196608 2112090 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Apr 9 17:49:45 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Apr 9 17:49:45 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: 0x10438b260>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Apr 9 17:49:47 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Apr 9 17:49:48 2026"
>
> ColMode(tmp2)
<pointer: 0x10438b260>
>
>
>
> ### 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.1958561 -0.74386252 -0.4728620 0.6240940
[2,] -0.3369671 0.18727608 -0.4544487 -0.2855635
[3,] -0.6011935 -0.05629706 -1.1903656 0.3345313
[4,] 0.2547250 -0.57579917 0.1125832 -0.3537864
> 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.1958561 0.74386252 0.4728620 0.6240940
[2,] 0.3369671 0.18727608 0.4544487 0.2855635
[3,] 0.6011935 0.05629706 1.1903656 0.3345313
[4,] 0.2547250 0.57579917 0.1125832 0.3537864
> 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.9597116 0.8624746 0.6876496 0.7899962
[2,] 0.5804887 0.4327541 0.6741281 0.5343814
[3,] 0.7753667 0.2372700 1.0910388 0.5783868
[4,] 0.5047028 0.7588143 0.3355342 0.5947995
>
> 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,] 223.79297 34.36861 32.34936 33.52406
[2,] 31.14185 29.51482 32.19573 30.62938
[3,] 33.35486 27.42900 37.10075 31.11840
[4,] 30.30175 33.16394 28.46793 31.30178
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x10439c6f0>
> exp(tmp5)
<pointer: 0x10439c6f0>
> log(tmp5,2)
<pointer: 0x10439c6f0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7958
> Min(tmp5)
[1] 53.65042
> mean(tmp5)
[1] 72.37893
> Sum(tmp5)
[1] 14475.79
> Var(tmp5)
[1] 843.0472
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.27313 70.94022 70.41836 68.46374 69.23872 71.00981 69.67110 71.17380
[9] 71.22010 70.38037
> rowSums(tmp5)
[1] 1825.463 1418.804 1408.367 1369.275 1384.774 1420.196 1393.422 1423.476
[9] 1424.402 1407.607
> rowVars(tmp5)
[1] 7827.91924 56.39890 96.64610 35.94630 49.61413 51.33227
[7] 87.14561 55.54025 72.61648 71.29283
> rowSd(tmp5)
[1] 88.475529 7.509920 9.830875 5.995524 7.043730 7.164654 9.335181
[8] 7.452533 8.521530 8.443508
> rowMax(tmp5)
[1] 465.79575 87.32902 86.65649 80.43404 82.15461 80.71347 92.66062
[8] 83.64672 88.53045 85.84445
> rowMin(tmp5)
[1] 56.11028 55.62075 56.48408 59.25226 53.73519 55.41321 53.65042 55.17278
[9] 55.46709 57.07470
>
> colMeans(tmp5)
[1] 112.96668 68.12633 71.90968 65.40722 67.64475 70.87692 71.00069
[8] 69.36154 72.84234 68.26669 71.14460 73.23928 69.39958 68.45262
[15] 74.26033 66.71752 68.17422 68.95184 76.30997 72.52590
> colSums(tmp5)
[1] 1129.6668 681.2633 719.0968 654.0722 676.4475 708.7692 710.0069
[8] 693.6154 728.4234 682.6669 711.4460 732.3928 693.9958 684.5262
[15] 742.6033 667.1752 681.7422 689.5184 763.0997 725.2590
> colVars(tmp5)
[1] 15439.14562 26.98653 82.39249 36.69818 102.88513 49.02125
[7] 40.10810 58.48505 39.03220 57.88585 95.04694 91.77049
[13] 45.06044 57.63969 77.01027 62.41558 88.92022 25.40956
[19] 21.58672 60.85575
> colSd(tmp5)
[1] 124.254359 5.194856 9.077031 6.057902 10.143231 7.001518
[7] 6.333095 7.647552 6.247576 7.608275 9.749202 9.579691
[13] 6.712707 7.592081 8.775550 7.900353 9.429752 5.040789
[19] 4.646151 7.801009
> colMax(tmp5)
[1] 465.79575 74.45108 92.66062 76.81079 86.65649 81.63234 81.34311
[8] 82.15461 85.46840 80.71347 87.32902 84.75246 76.93675 78.51819
[15] 88.53045 80.16736 81.63614 74.60670 82.84682 88.12122
> colMin(tmp5)
[1] 63.06913 57.08986 59.25226 55.46709 56.11028 56.48408 63.18169 58.33424
[9] 66.04733 59.09036 57.45811 57.40927 58.96033 53.73519 56.84501 55.17278
[17] 53.65042 59.86480 67.71639 60.73693
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.27313 70.94022 70.41836 68.46374 69.23872 71.00981 NA 71.17380
[9] 71.22010 70.38037
> rowSums(tmp5)
[1] 1825.463 1418.804 1408.367 1369.275 1384.774 1420.196 NA 1423.476
[9] 1424.402 1407.607
> rowVars(tmp5)
[1] 7827.91924 56.39890 96.64610 35.94630 49.61413 51.33227
[7] 91.33873 55.54025 72.61648 71.29283
> rowSd(tmp5)
[1] 88.475529 7.509920 9.830875 5.995524 7.043730 7.164654 9.557130
[8] 7.452533 8.521530 8.443508
> rowMax(tmp5)
[1] 465.79575 87.32902 86.65649 80.43404 82.15461 80.71347 NA
[8] 83.64672 88.53045 85.84445
> rowMin(tmp5)
[1] 56.11028 55.62075 56.48408 59.25226 53.73519 55.41321 NA 55.17278
[9] 55.46709 57.07470
>
> colMeans(tmp5)
[1] 112.96668 68.12633 71.90968 65.40722 67.64475 70.87692 71.00069
[8] 69.36154 72.84234 68.26669 71.14460 73.23928 69.39958 68.45262
[15] 74.26033 NA 68.17422 68.95184 76.30997 72.52590
> colSums(tmp5)
[1] 1129.6668 681.2633 719.0968 654.0722 676.4475 708.7692 710.0069
[8] 693.6154 728.4234 682.6669 711.4460 732.3928 693.9958 684.5262
[15] 742.6033 NA 681.7422 689.5184 763.0997 725.2590
> colVars(tmp5)
[1] 15439.14562 26.98653 82.39249 36.69818 102.88513 49.02125
[7] 40.10810 58.48505 39.03220 57.88585 95.04694 91.77049
[13] 45.06044 57.63969 77.01027 NA 88.92022 25.40956
[19] 21.58672 60.85575
> colSd(tmp5)
[1] 124.254359 5.194856 9.077031 6.057902 10.143231 7.001518
[7] 6.333095 7.647552 6.247576 7.608275 9.749202 9.579691
[13] 6.712707 7.592081 8.775550 NA 9.429752 5.040789
[19] 4.646151 7.801009
> colMax(tmp5)
[1] 465.79575 74.45108 92.66062 76.81079 86.65649 81.63234 81.34311
[8] 82.15461 85.46840 80.71347 87.32902 84.75246 76.93675 78.51819
[15] 88.53045 NA 81.63614 74.60670 82.84682 88.12122
> colMin(tmp5)
[1] 63.06913 57.08986 59.25226 55.46709 56.11028 56.48408 63.18169 58.33424
[9] 66.04733 59.09036 57.45811 57.40927 58.96033 53.73519 56.84501 NA
[17] 53.65042 59.86480 67.71639 60.73693
>
> Max(tmp5,na.rm=TRUE)
[1] 465.7958
> Min(tmp5,na.rm=TRUE)
[1] 53.65042
> mean(tmp5,na.rm=TRUE)
[1] 72.40927
> Sum(tmp5,na.rm=TRUE)
[1] 14409.45
> Var(tmp5,na.rm=TRUE)
[1] 847.12
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.27313 70.94022 70.41836 68.46374 69.23872 71.00981 69.84634 71.17380
[9] 71.22010 70.38037
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.463 1418.804 1408.367 1369.275 1384.774 1420.196 1327.080 1423.476
[9] 1424.402 1407.607
> rowVars(tmp5,na.rm=TRUE)
[1] 7827.91924 56.39890 96.64610 35.94630 49.61413 51.33227
[7] 91.33873 55.54025 72.61648 71.29283
> rowSd(tmp5,na.rm=TRUE)
[1] 88.475529 7.509920 9.830875 5.995524 7.043730 7.164654 9.557130
[8] 7.452533 8.521530 8.443508
> rowMax(tmp5,na.rm=TRUE)
[1] 465.79575 87.32902 86.65649 80.43404 82.15461 80.71347 92.66062
[8] 83.64672 88.53045 85.84445
> rowMin(tmp5,na.rm=TRUE)
[1] 56.11028 55.62075 56.48408 59.25226 53.73519 55.41321 53.65042 55.17278
[9] 55.46709 57.07470
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.96668 68.12633 71.90968 65.40722 67.64475 70.87692 71.00069
[8] 69.36154 72.84234 68.26669 71.14460 73.23928 69.39958 68.45262
[15] 74.26033 66.75930 68.17422 68.95184 76.30997 72.52590
> colSums(tmp5,na.rm=TRUE)
[1] 1129.6668 681.2633 719.0968 654.0722 676.4475 708.7692 710.0069
[8] 693.6154 728.4234 682.6669 711.4460 732.3928 693.9958 684.5262
[15] 742.6033 600.8337 681.7422 689.5184 763.0997 725.2590
> colVars(tmp5,na.rm=TRUE)
[1] 15439.14562 26.98653 82.39249 36.69818 102.88513 49.02125
[7] 40.10810 58.48505 39.03220 57.88585 95.04694 91.77049
[13] 45.06044 57.63969 77.01027 70.19790 88.92022 25.40956
[19] 21.58672 60.85575
> colSd(tmp5,na.rm=TRUE)
[1] 124.254359 5.194856 9.077031 6.057902 10.143231 7.001518
[7] 6.333095 7.647552 6.247576 7.608275 9.749202 9.579691
[13] 6.712707 7.592081 8.775550 8.378418 9.429752 5.040789
[19] 4.646151 7.801009
> colMax(tmp5,na.rm=TRUE)
[1] 465.79575 74.45108 92.66062 76.81079 86.65649 81.63234 81.34311
[8] 82.15461 85.46840 80.71347 87.32902 84.75246 76.93675 78.51819
[15] 88.53045 80.16736 81.63614 74.60670 82.84682 88.12122
> colMin(tmp5,na.rm=TRUE)
[1] 63.06913 57.08986 59.25226 55.46709 56.11028 56.48408 63.18169 58.33424
[9] 66.04733 59.09036 57.45811 57.40927 58.96033 53.73519 56.84501 55.17278
[17] 53.65042 59.86480 67.71639 60.73693
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.27313 70.94022 70.41836 68.46374 69.23872 71.00981 NaN 71.17380
[9] 71.22010 70.38037
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.463 1418.804 1408.367 1369.275 1384.774 1420.196 0.000 1423.476
[9] 1424.402 1407.607
> rowVars(tmp5,na.rm=TRUE)
[1] 7827.91924 56.39890 96.64610 35.94630 49.61413 51.33227
[7] NA 55.54025 72.61648 71.29283
> rowSd(tmp5,na.rm=TRUE)
[1] 88.475529 7.509920 9.830875 5.995524 7.043730 7.164654 NA
[8] 7.452533 8.521530 8.443508
> rowMax(tmp5,na.rm=TRUE)
[1] 465.79575 87.32902 86.65649 80.43404 82.15461 80.71347 NA
[8] 83.64672 88.53045 85.84445
> rowMin(tmp5,na.rm=TRUE)
[1] 56.11028 55.62075 56.48408 59.25226 53.73519 55.41321 NA 55.17278
[9] 55.46709 57.07470
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.27164 68.09886 69.60402 65.25027 68.41485 70.76285 70.61310
[8] 69.33823 72.82257 67.84564 72.56106 74.51163 69.54138 69.32612
[15] 73.53094 NaN 69.78797 68.43135 76.28857 73.83578
> colSums(tmp5,na.rm=TRUE)
[1] 1046.4448 612.8897 626.4361 587.2524 615.7337 636.8657 635.5179
[8] 624.0441 655.4031 610.6107 653.0495 670.6046 625.8724 623.9350
[15] 661.7785 0.0000 628.0918 615.8821 686.5972 664.5220
> colVars(tmp5,na.rm=TRUE)
[1] 17246.15740 30.35136 32.88577 41.00831 109.07381 55.00252
[7] 43.43156 65.78957 43.90683 63.12710 84.35629 85.02968
[13] 50.46680 56.26092 80.65137 NA 70.73792 25.53802
[19] 24.27991 49.15998
> colSd(tmp5,na.rm=TRUE)
[1] 131.324626 5.509207 5.734612 6.403773 10.443841 7.416368
[7] 6.590262 8.111077 6.626223 7.945257 9.184568 9.221154
[13] 7.103999 7.500728 8.980611 NA 8.410584 5.053515
[19] 4.927465 7.011418
> colMax(tmp5,na.rm=TRUE)
[1] 465.79575 74.45108 77.22036 76.81079 86.65649 81.63234 81.34311
[8] 82.15461 85.46840 80.71347 87.32902 84.75246 76.93675 78.51819
[15] 88.53045 -Inf 81.63614 74.60670 82.84682 88.12122
> colMin(tmp5,na.rm=TRUE)
[1] 63.06913 57.08986 59.25226 55.46709 56.11028 56.48408 63.18169 58.33424
[9] 66.04733 59.09036 57.45811 57.40927 58.96033 53.73519 56.84501 Inf
[17] 55.41321 59.86480 67.71639 64.12856
>
>
>
>
> 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] 249.3933 100.3173 195.9113 184.3465 384.2591 319.0628 149.2540 161.6272
[9] 105.0382 269.5326
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 249.3933 100.3173 195.9113 184.3465 384.2591 319.0628 149.2540 161.6272
[9] 105.0382 269.5326
>
>
>
> 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.278977e-13 -1.705303e-13 -1.705303e-13 -2.842171e-14 -5.684342e-14
[6] -1.705303e-13 5.684342e-14 5.684342e-14 0.000000e+00 0.000000e+00
[11] 1.705303e-13 0.000000e+00 0.000000e+00 -1.136868e-13 -2.842171e-14
[16] 2.842171e-14 -1.136868e-13 -1.136868e-13 0.000000e+00 -2.842171e-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)
+ }
5 15
8 14
10 10
1 7
2 19
6 10
8 20
6 11
2 19
4 2
9 10
4 17
10 12
8 19
4 17
8 11
1 8
3 13
7 18
1 18
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.872899
> Min(tmp)
[1] -1.847806
> mean(tmp)
[1] 0.02735171
> Sum(tmp)
[1] 2.735171
> Var(tmp)
[1] 0.9486766
>
> rowMeans(tmp)
[1] 0.02735171
> rowSums(tmp)
[1] 2.735171
> rowVars(tmp)
[1] 0.9486766
> rowSd(tmp)
[1] 0.9740003
> rowMax(tmp)
[1] 2.872899
> rowMin(tmp)
[1] -1.847806
>
> colMeans(tmp)
[1] -0.83026869 0.66872300 0.06243921 -0.78279099 -0.97016846 -0.22566545
[7] -0.25044694 -1.16135915 1.73466635 1.57952983 0.51803045 0.74342409
[13] 0.31717011 -1.06207926 -1.84780554 -0.09285231 0.65997239 1.92571705
[19] -0.52297512 0.95814748 0.54453731 0.10393607 -0.27187021 0.03227290
[25] 0.24610186 0.82813850 -0.07412187 -1.35079708 -0.68098630 0.74026979
[31] 2.67351591 -0.86932957 1.40661230 0.27256760 0.08192019 -0.48749858
[37] 1.10048721 -0.74613294 -0.04805603 -0.46218095 0.62270435 -0.44291523
[43] 1.34291756 -0.82686609 0.66442192 -0.73071438 -0.31946138 -0.86160320
[49] -0.17814169 1.50592746 -1.56116764 -0.28249673 -0.49769170 0.61546836
[55] 0.23980368 2.87289881 -0.31944134 -0.48804526 0.41257510 -0.93607675
[61] -0.02357104 -0.03253154 2.03933400 -0.62573962 -1.05704520 2.56045327
[67] -0.49093514 -1.80455350 -0.50418045 0.24753024 0.63678127 0.19554270
[73] -0.52560894 -0.82910147 -0.28585971 -1.14152260 0.38761194 0.07520949
[79] -0.74227538 1.38992830 -0.44365030 0.76028732 0.64849888 0.71451031
[85] -0.88233505 0.81045103 -1.04616951 0.05108316 -0.49167238 -0.14980218
[91] 1.60298019 -1.00357954 -1.32526529 -0.21956423 -1.71291304 0.51430058
[97] -1.19276075 -0.19085746 1.04590591 0.48336675
> colSums(tmp)
[1] -0.83026869 0.66872300 0.06243921 -0.78279099 -0.97016846 -0.22566545
[7] -0.25044694 -1.16135915 1.73466635 1.57952983 0.51803045 0.74342409
[13] 0.31717011 -1.06207926 -1.84780554 -0.09285231 0.65997239 1.92571705
[19] -0.52297512 0.95814748 0.54453731 0.10393607 -0.27187021 0.03227290
[25] 0.24610186 0.82813850 -0.07412187 -1.35079708 -0.68098630 0.74026979
[31] 2.67351591 -0.86932957 1.40661230 0.27256760 0.08192019 -0.48749858
[37] 1.10048721 -0.74613294 -0.04805603 -0.46218095 0.62270435 -0.44291523
[43] 1.34291756 -0.82686609 0.66442192 -0.73071438 -0.31946138 -0.86160320
[49] -0.17814169 1.50592746 -1.56116764 -0.28249673 -0.49769170 0.61546836
[55] 0.23980368 2.87289881 -0.31944134 -0.48804526 0.41257510 -0.93607675
[61] -0.02357104 -0.03253154 2.03933400 -0.62573962 -1.05704520 2.56045327
[67] -0.49093514 -1.80455350 -0.50418045 0.24753024 0.63678127 0.19554270
[73] -0.52560894 -0.82910147 -0.28585971 -1.14152260 0.38761194 0.07520949
[79] -0.74227538 1.38992830 -0.44365030 0.76028732 0.64849888 0.71451031
[85] -0.88233505 0.81045103 -1.04616951 0.05108316 -0.49167238 -0.14980218
[91] 1.60298019 -1.00357954 -1.32526529 -0.21956423 -1.71291304 0.51430058
[97] -1.19276075 -0.19085746 1.04590591 0.48336675
> 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.83026869 0.66872300 0.06243921 -0.78279099 -0.97016846 -0.22566545
[7] -0.25044694 -1.16135915 1.73466635 1.57952983 0.51803045 0.74342409
[13] 0.31717011 -1.06207926 -1.84780554 -0.09285231 0.65997239 1.92571705
[19] -0.52297512 0.95814748 0.54453731 0.10393607 -0.27187021 0.03227290
[25] 0.24610186 0.82813850 -0.07412187 -1.35079708 -0.68098630 0.74026979
[31] 2.67351591 -0.86932957 1.40661230 0.27256760 0.08192019 -0.48749858
[37] 1.10048721 -0.74613294 -0.04805603 -0.46218095 0.62270435 -0.44291523
[43] 1.34291756 -0.82686609 0.66442192 -0.73071438 -0.31946138 -0.86160320
[49] -0.17814169 1.50592746 -1.56116764 -0.28249673 -0.49769170 0.61546836
[55] 0.23980368 2.87289881 -0.31944134 -0.48804526 0.41257510 -0.93607675
[61] -0.02357104 -0.03253154 2.03933400 -0.62573962 -1.05704520 2.56045327
[67] -0.49093514 -1.80455350 -0.50418045 0.24753024 0.63678127 0.19554270
[73] -0.52560894 -0.82910147 -0.28585971 -1.14152260 0.38761194 0.07520949
[79] -0.74227538 1.38992830 -0.44365030 0.76028732 0.64849888 0.71451031
[85] -0.88233505 0.81045103 -1.04616951 0.05108316 -0.49167238 -0.14980218
[91] 1.60298019 -1.00357954 -1.32526529 -0.21956423 -1.71291304 0.51430058
[97] -1.19276075 -0.19085746 1.04590591 0.48336675
> colMin(tmp)
[1] -0.83026869 0.66872300 0.06243921 -0.78279099 -0.97016846 -0.22566545
[7] -0.25044694 -1.16135915 1.73466635 1.57952983 0.51803045 0.74342409
[13] 0.31717011 -1.06207926 -1.84780554 -0.09285231 0.65997239 1.92571705
[19] -0.52297512 0.95814748 0.54453731 0.10393607 -0.27187021 0.03227290
[25] 0.24610186 0.82813850 -0.07412187 -1.35079708 -0.68098630 0.74026979
[31] 2.67351591 -0.86932957 1.40661230 0.27256760 0.08192019 -0.48749858
[37] 1.10048721 -0.74613294 -0.04805603 -0.46218095 0.62270435 -0.44291523
[43] 1.34291756 -0.82686609 0.66442192 -0.73071438 -0.31946138 -0.86160320
[49] -0.17814169 1.50592746 -1.56116764 -0.28249673 -0.49769170 0.61546836
[55] 0.23980368 2.87289881 -0.31944134 -0.48804526 0.41257510 -0.93607675
[61] -0.02357104 -0.03253154 2.03933400 -0.62573962 -1.05704520 2.56045327
[67] -0.49093514 -1.80455350 -0.50418045 0.24753024 0.63678127 0.19554270
[73] -0.52560894 -0.82910147 -0.28585971 -1.14152260 0.38761194 0.07520949
[79] -0.74227538 1.38992830 -0.44365030 0.76028732 0.64849888 0.71451031
[85] -0.88233505 0.81045103 -1.04616951 0.05108316 -0.49167238 -0.14980218
[91] 1.60298019 -1.00357954 -1.32526529 -0.21956423 -1.71291304 0.51430058
[97] -1.19276075 -0.19085746 1.04590591 0.48336675
> colMedians(tmp)
[1] -0.83026869 0.66872300 0.06243921 -0.78279099 -0.97016846 -0.22566545
[7] -0.25044694 -1.16135915 1.73466635 1.57952983 0.51803045 0.74342409
[13] 0.31717011 -1.06207926 -1.84780554 -0.09285231 0.65997239 1.92571705
[19] -0.52297512 0.95814748 0.54453731 0.10393607 -0.27187021 0.03227290
[25] 0.24610186 0.82813850 -0.07412187 -1.35079708 -0.68098630 0.74026979
[31] 2.67351591 -0.86932957 1.40661230 0.27256760 0.08192019 -0.48749858
[37] 1.10048721 -0.74613294 -0.04805603 -0.46218095 0.62270435 -0.44291523
[43] 1.34291756 -0.82686609 0.66442192 -0.73071438 -0.31946138 -0.86160320
[49] -0.17814169 1.50592746 -1.56116764 -0.28249673 -0.49769170 0.61546836
[55] 0.23980368 2.87289881 -0.31944134 -0.48804526 0.41257510 -0.93607675
[61] -0.02357104 -0.03253154 2.03933400 -0.62573962 -1.05704520 2.56045327
[67] -0.49093514 -1.80455350 -0.50418045 0.24753024 0.63678127 0.19554270
[73] -0.52560894 -0.82910147 -0.28585971 -1.14152260 0.38761194 0.07520949
[79] -0.74227538 1.38992830 -0.44365030 0.76028732 0.64849888 0.71451031
[85] -0.88233505 0.81045103 -1.04616951 0.05108316 -0.49167238 -0.14980218
[91] 1.60298019 -1.00357954 -1.32526529 -0.21956423 -1.71291304 0.51430058
[97] -1.19276075 -0.19085746 1.04590591 0.48336675
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.8302687 0.668723 0.06243921 -0.782791 -0.9701685 -0.2256654 -0.2504469
[2,] -0.8302687 0.668723 0.06243921 -0.782791 -0.9701685 -0.2256654 -0.2504469
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.161359 1.734666 1.57953 0.5180304 0.7434241 0.3171701 -1.062079
[2,] -1.161359 1.734666 1.57953 0.5180304 0.7434241 0.3171701 -1.062079
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.847806 -0.09285231 0.6599724 1.925717 -0.5229751 0.9581475 0.5445373
[2,] -1.847806 -0.09285231 0.6599724 1.925717 -0.5229751 0.9581475 0.5445373
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.1039361 -0.2718702 0.0322729 0.2461019 0.8281385 -0.07412187 -1.350797
[2,] 0.1039361 -0.2718702 0.0322729 0.2461019 0.8281385 -0.07412187 -1.350797
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.6809863 0.7402698 2.673516 -0.8693296 1.406612 0.2725676 0.08192019
[2,] -0.6809863 0.7402698 2.673516 -0.8693296 1.406612 0.2725676 0.08192019
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.4874986 1.100487 -0.7461329 -0.04805603 -0.4621809 0.6227044 -0.4429152
[2,] -0.4874986 1.100487 -0.7461329 -0.04805603 -0.4621809 0.6227044 -0.4429152
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.342918 -0.8268661 0.6644219 -0.7307144 -0.3194614 -0.8616032 -0.1781417
[2,] 1.342918 -0.8268661 0.6644219 -0.7307144 -0.3194614 -0.8616032 -0.1781417
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.505927 -1.561168 -0.2824967 -0.4976917 0.6154684 0.2398037 2.872899
[2,] 1.505927 -1.561168 -0.2824967 -0.4976917 0.6154684 0.2398037 2.872899
[,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.3194413 -0.4880453 0.4125751 -0.9360767 -0.02357104 -0.03253154
[2,] -0.3194413 -0.4880453 0.4125751 -0.9360767 -0.02357104 -0.03253154
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 2.039334 -0.6257396 -1.057045 2.560453 -0.4909351 -1.804554 -0.5041805
[2,] 2.039334 -0.6257396 -1.057045 2.560453 -0.4909351 -1.804554 -0.5041805
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.2475302 0.6367813 0.1955427 -0.5256089 -0.8291015 -0.2858597 -1.141523
[2,] 0.2475302 0.6367813 0.1955427 -0.5256089 -0.8291015 -0.2858597 -1.141523
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.3876119 0.07520949 -0.7422754 1.389928 -0.4436503 0.7602873 0.6484989
[2,] 0.3876119 0.07520949 -0.7422754 1.389928 -0.4436503 0.7602873 0.6484989
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.7145103 -0.882335 0.810451 -1.04617 0.05108316 -0.4916724 -0.1498022
[2,] 0.7145103 -0.882335 0.810451 -1.04617 0.05108316 -0.4916724 -0.1498022
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 1.60298 -1.00358 -1.325265 -0.2195642 -1.712913 0.5143006 -1.192761
[2,] 1.60298 -1.00358 -1.325265 -0.2195642 -1.712913 0.5143006 -1.192761
[,98] [,99] [,100]
[1,] -0.1908575 1.045906 0.4833668
[2,] -0.1908575 1.045906 0.4833668
>
>
> Max(tmp2)
[1] 2.536248
> Min(tmp2)
[1] -3.286947
> mean(tmp2)
[1] 0.06801663
> Sum(tmp2)
[1] 6.801663
> Var(tmp2)
[1] 1.3687
>
> rowMeans(tmp2)
[1] -0.152631982 -1.763022027 0.553142333 -0.045050284 -0.909903367
[6] 0.004945677 0.701522916 0.356473703 1.155139999 -0.718291637
[11] 0.824602526 -1.149340372 0.658814349 1.845273962 -0.856875151
[16] 0.183410299 -1.154552989 0.895952034 -1.437842942 0.921632170
[21] 2.121661302 0.855469950 -0.650386302 -0.289129891 1.205721583
[26] 1.257073060 0.675042689 0.972244375 -1.785116031 -1.453809076
[31] 2.337577620 1.777548256 0.289390874 1.741365913 1.327862602
[36] 0.948357765 1.804866965 0.496803583 0.980963746 -0.043628585
[41] -0.330127662 -1.026608343 -0.112434706 1.008510225 -0.731064990
[46] -0.565073449 -0.234222199 -3.286947394 2.397061915 0.540820587
[51] -0.490972385 -0.583251972 -0.605766743 0.041267378 0.357823297
[56] -0.565177853 -0.671887479 -0.568576806 -0.958841613 0.223439216
[61] -0.317010305 -1.228568714 1.395873928 0.451092845 1.716661518
[66] 2.536247765 0.813395981 1.482076585 -2.562222591 -0.638003649
[71] -0.914442837 0.824484995 -0.119726824 -0.364479797 1.489608706
[76] 1.891246330 -1.143509538 1.365158179 0.550885010 -2.443777272
[81] -2.350290280 -0.374517588 -0.448766799 0.500770286 -0.159277476
[86] -0.265824434 -0.566109702 -0.690914657 -0.830467122 -1.234794130
[91] -0.457282983 1.341920165 -0.649459401 -0.342500982 -1.537287408
[96] 1.086886198 -1.345236602 1.728624583 0.368668738 -0.078716556
> rowSums(tmp2)
[1] -0.152631982 -1.763022027 0.553142333 -0.045050284 -0.909903367
[6] 0.004945677 0.701522916 0.356473703 1.155139999 -0.718291637
[11] 0.824602526 -1.149340372 0.658814349 1.845273962 -0.856875151
[16] 0.183410299 -1.154552989 0.895952034 -1.437842942 0.921632170
[21] 2.121661302 0.855469950 -0.650386302 -0.289129891 1.205721583
[26] 1.257073060 0.675042689 0.972244375 -1.785116031 -1.453809076
[31] 2.337577620 1.777548256 0.289390874 1.741365913 1.327862602
[36] 0.948357765 1.804866965 0.496803583 0.980963746 -0.043628585
[41] -0.330127662 -1.026608343 -0.112434706 1.008510225 -0.731064990
[46] -0.565073449 -0.234222199 -3.286947394 2.397061915 0.540820587
[51] -0.490972385 -0.583251972 -0.605766743 0.041267378 0.357823297
[56] -0.565177853 -0.671887479 -0.568576806 -0.958841613 0.223439216
[61] -0.317010305 -1.228568714 1.395873928 0.451092845 1.716661518
[66] 2.536247765 0.813395981 1.482076585 -2.562222591 -0.638003649
[71] -0.914442837 0.824484995 -0.119726824 -0.364479797 1.489608706
[76] 1.891246330 -1.143509538 1.365158179 0.550885010 -2.443777272
[81] -2.350290280 -0.374517588 -0.448766799 0.500770286 -0.159277476
[86] -0.265824434 -0.566109702 -0.690914657 -0.830467122 -1.234794130
[91] -0.457282983 1.341920165 -0.649459401 -0.342500982 -1.537287408
[96] 1.086886198 -1.345236602 1.728624583 0.368668738 -0.078716556
> 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.152631982 -1.763022027 0.553142333 -0.045050284 -0.909903367
[6] 0.004945677 0.701522916 0.356473703 1.155139999 -0.718291637
[11] 0.824602526 -1.149340372 0.658814349 1.845273962 -0.856875151
[16] 0.183410299 -1.154552989 0.895952034 -1.437842942 0.921632170
[21] 2.121661302 0.855469950 -0.650386302 -0.289129891 1.205721583
[26] 1.257073060 0.675042689 0.972244375 -1.785116031 -1.453809076
[31] 2.337577620 1.777548256 0.289390874 1.741365913 1.327862602
[36] 0.948357765 1.804866965 0.496803583 0.980963746 -0.043628585
[41] -0.330127662 -1.026608343 -0.112434706 1.008510225 -0.731064990
[46] -0.565073449 -0.234222199 -3.286947394 2.397061915 0.540820587
[51] -0.490972385 -0.583251972 -0.605766743 0.041267378 0.357823297
[56] -0.565177853 -0.671887479 -0.568576806 -0.958841613 0.223439216
[61] -0.317010305 -1.228568714 1.395873928 0.451092845 1.716661518
[66] 2.536247765 0.813395981 1.482076585 -2.562222591 -0.638003649
[71] -0.914442837 0.824484995 -0.119726824 -0.364479797 1.489608706
[76] 1.891246330 -1.143509538 1.365158179 0.550885010 -2.443777272
[81] -2.350290280 -0.374517588 -0.448766799 0.500770286 -0.159277476
[86] -0.265824434 -0.566109702 -0.690914657 -0.830467122 -1.234794130
[91] -0.457282983 1.341920165 -0.649459401 -0.342500982 -1.537287408
[96] 1.086886198 -1.345236602 1.728624583 0.368668738 -0.078716556
> rowMin(tmp2)
[1] -0.152631982 -1.763022027 0.553142333 -0.045050284 -0.909903367
[6] 0.004945677 0.701522916 0.356473703 1.155139999 -0.718291637
[11] 0.824602526 -1.149340372 0.658814349 1.845273962 -0.856875151
[16] 0.183410299 -1.154552989 0.895952034 -1.437842942 0.921632170
[21] 2.121661302 0.855469950 -0.650386302 -0.289129891 1.205721583
[26] 1.257073060 0.675042689 0.972244375 -1.785116031 -1.453809076
[31] 2.337577620 1.777548256 0.289390874 1.741365913 1.327862602
[36] 0.948357765 1.804866965 0.496803583 0.980963746 -0.043628585
[41] -0.330127662 -1.026608343 -0.112434706 1.008510225 -0.731064990
[46] -0.565073449 -0.234222199 -3.286947394 2.397061915 0.540820587
[51] -0.490972385 -0.583251972 -0.605766743 0.041267378 0.357823297
[56] -0.565177853 -0.671887479 -0.568576806 -0.958841613 0.223439216
[61] -0.317010305 -1.228568714 1.395873928 0.451092845 1.716661518
[66] 2.536247765 0.813395981 1.482076585 -2.562222591 -0.638003649
[71] -0.914442837 0.824484995 -0.119726824 -0.364479797 1.489608706
[76] 1.891246330 -1.143509538 1.365158179 0.550885010 -2.443777272
[81] -2.350290280 -0.374517588 -0.448766799 0.500770286 -0.159277476
[86] -0.265824434 -0.566109702 -0.690914657 -0.830467122 -1.234794130
[91] -0.457282983 1.341920165 -0.649459401 -0.342500982 -1.537287408
[96] 1.086886198 -1.345236602 1.728624583 0.368668738 -0.078716556
>
> colMeans(tmp2)
[1] 0.06801663
> colSums(tmp2)
[1] 6.801663
> colVars(tmp2)
[1] 1.3687
> colSd(tmp2)
[1] 1.169914
> colMax(tmp2)
[1] 2.536248
> colMin(tmp2)
[1] -3.286947
> colMedians(tmp2)
[1] -0.06188342
> colRanges(tmp2)
[,1]
[1,] -3.286947
[2,] 2.536248
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.9692134 -1.2054047 0.2431737 -2.5746271 2.3177261 2.9189129
[7] 1.3524758 0.6909453 2.7180051 -3.8912871
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0924837
[2,] -0.8157767
[3,] -0.1829524
[4,] 0.6494468
[5,] 2.0398090
>
> rowApply(tmp,sum)
[1] 2.72148268 0.82710514 -0.09659442 -2.30895328 1.81303413 0.35683648
[7] 9.15042558 -3.32754931 -6.36759033 0.77093676
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 7 6 2 6 5 9 10 5 3
[2,] 5 10 1 6 3 3 7 7 4 5
[3,] 7 6 4 9 7 4 1 9 3 6
[4,] 10 4 7 4 1 7 3 6 1 2
[5,] 2 3 10 8 2 9 4 8 10 1
[6,] 3 8 8 10 5 6 10 1 6 10
[7,] 4 1 5 1 10 8 8 4 9 4
[8,] 1 9 9 5 9 1 2 3 8 9
[9,] 8 5 2 3 8 10 5 5 7 7
[10,] 6 2 3 7 4 2 6 2 2 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.03931570 -0.51355781 2.95094162 1.32065181 1.47679198 -3.35402217
[7] -0.81105001 0.54558317 -0.77148577 1.18639608 -0.06281775 -2.73466937
[13] -0.14764612 3.51811527 -4.23289420 -1.36626009 0.18080764 -1.13720195
[19] 0.26324527 0.83340276
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6999500
[2,] -1.2543292
[3,] 0.1566499
[4,] 0.4355388
[5,] 2.3227748
>
> rowApply(tmp,sum)
[1] 1.0061736 -0.5710017 -1.3477935 -3.1389680 1.1566043
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 13 14 4 20
[2,] 5 14 9 7 17
[3,] 12 20 7 18 14
[4,] 16 16 10 11 6
[5,] 13 4 16 16 15
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.6999500 -0.8707663 0.06900876 1.09377978 0.2172409 -1.0106128
[2,] 0.1566499 0.1800046 1.65020556 0.44320985 -0.6793996 -0.5842185
[3,] 0.4355388 -0.2259735 -0.33242818 0.20711126 0.5316067 0.9504398
[4,] -1.2543292 -1.0267923 1.07367241 -0.01873399 0.8367471 -1.1839344
[5,] 2.3227748 1.4299696 0.49048307 -0.40471509 0.5705968 -1.5256963
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.0184228 -0.7120411 -0.120253043 1.00517131 -0.2760739 -0.5921776
[2,] -0.9077210 -0.5651306 0.423383844 1.08990297 -0.1263754 1.1692224
[3,] -0.5400826 -0.3310292 0.322927447 -1.43766933 0.4654061 -0.4469683
[4,] 0.8997494 2.4825790 -1.404640153 0.52642525 0.1050898 -1.0291560
[5,] 0.7554271 -0.3287950 0.007096139 0.00256588 -0.2308643 -1.8355898
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.38918636 1.7171172 -0.03854571 1.7557541 0.3486193 -1.0801070
[2,] 0.05242167 -0.1823186 -0.22378141 -1.6444111 -0.9107547 1.1837979
[3,] -0.37497850 0.6328505 -1.93226739 0.3452457 -1.0622340 0.5464722
[4,] 1.16246295 -0.5435245 -0.37489396 -1.5687856 0.2337859 -1.4317082
[5,] -0.59836587 1.8939906 -1.66340573 -0.2540632 1.5713911 -0.3556567
[,19] [,20]
[1,] 1.39164118 1.2159778
[2,] -0.67735396 -0.4183355
[3,] 0.56746292 0.3307761
[4,] 0.01107613 -0.6340578
[5,] -1.02958100 0.3390422
>
>
> 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 : 645 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 558 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6591662 0.2992514 -0.1892275 0.2392044 -1.015741 1.026461 0.5689287
col8 col9 col10 col11 col12 col13 col14
row1 -1.86069 -1.12089 -0.02718424 -0.3901271 0.5180982 1.390931 -0.3107999
col15 col16 col17 col18 col19 col20
row1 -0.1158434 -1.072019 0.07996833 1.054547 1.343755 1.811105
> tmp[,"col10"]
col10
row1 -0.02718424
row2 0.37917035
row3 -0.19527948
row4 -0.60865220
row5 -0.88799088
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6591662 0.2992514 -0.1892275 0.2392044 -1.0157415 1.026461 0.5689287
row5 0.5597893 0.5189833 -0.0377186 1.0023701 0.9003863 -1.011925 -0.9856696
col8 col9 col10 col11 col12 col13
row1 -1.8606898 -1.1208896 -0.02718424 -0.3901271 0.5180982 1.3909308
row5 0.5447429 -0.9167363 -0.88799088 -1.1722052 -1.9620072 -0.5226764
col14 col15 col16 col17 col18 col19
row1 -0.3107999 -0.11584339 -1.0720194 0.07996833 1.054547 1.3437553
row5 0.2609743 0.05152273 -0.8787263 1.91738210 -0.145765 -0.3044725
col20
row1 1.8111053
row5 0.0247557
> tmp[,c("col6","col20")]
col6 col20
row1 1.02646058 1.8111053
row2 1.22061097 -0.7569630
row3 -0.09634917 -0.4398909
row4 0.45859409 1.3715949
row5 -1.01192476 0.0247557
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.026461 1.8111053
row5 -1.011925 0.0247557
>
>
>
>
> 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.37264 49.46773 49.81993 49.50954 49.15628 105.9438 50.44562 49.16043
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.27354 49.71103 49.98915 49.76332 49.04526 50.36881 51.50992 49.00793
col17 col18 col19 col20
row1 49.83028 50.7086 51.08739 106.3886
> tmp[,"col10"]
col10
row1 49.71103
row2 28.23683
row3 29.94743
row4 30.28874
row5 51.19143
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.37264 49.46773 49.81993 49.50954 49.15628 105.9438 50.44562 49.16043
row5 51.21210 50.62575 49.58943 51.33017 48.74922 105.6832 48.93515 50.88689
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.27354 49.71103 49.98915 49.76332 49.04526 50.36881 51.50992 49.00793
row5 50.43565 51.19143 50.55966 48.38820 50.76653 49.60741 50.70758 51.30254
col17 col18 col19 col20
row1 49.83028 50.70860 51.08739 106.3886
row5 50.70347 48.91545 51.41328 105.4800
> tmp[,c("col6","col20")]
col6 col20
row1 105.94378 106.38857
row2 75.62941 75.07979
row3 75.99466 74.70229
row4 74.56834 73.92641
row5 105.68324 105.47999
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.9438 106.3886
row5 105.6832 105.4800
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.9438 106.3886
row5 105.6832 105.4800
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 2.6302199
[2,] -0.6033362
[3,] 0.5556449
[4,] 1.9188833
[5,] 0.2899049
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.2118257 -0.1388372
[2,] -1.9062114 0.2615759
[3,] -0.6647490 -0.9399835
[4,] -0.1219735 0.6413134
[5,] -0.5970999 -0.8670597
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.9961480 -1.66316189
[2,] 1.3986549 0.08021444
[3,] 0.1931592 -1.88686130
[4,] -0.5717805 -0.56693979
[5,] -0.3299588 -1.36009090
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.996148
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.996148
[2,] 1.398655
>
>
>
> 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.1023611 -0.1467505 0.05675491 1.2190382 -0.5162639 -0.8883939 1.1269907
row1 0.3757371 -1.1719514 0.90364176 0.1746071 0.1306544 0.3829896 0.7052491
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.5600181 -0.7891260 0.1306549 -0.4061354 -1.1459953 0.4182283 0.4419885
row1 -0.2893436 -0.8920375 0.3075598 -0.9831599 0.1857111 0.4563588 1.8284246
[,15] [,16] [,17] [,18] [,19] [,20]
row3 0.0401439 0.2007434 -1.20130818 -0.9013551 -1.7465641 0.1494456
row1 -0.8842068 0.4429872 -0.07919962 -0.2249944 -0.3322143 0.3859547
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.01394563 1.15819 0.7324147 -1.244983 -0.1460452 -0.8911247 -1.02556
[,8] [,9] [,10]
row2 -0.1406413 -0.429252 0.1647471
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.9754771 -0.09844724 0.1343437 -0.9827625 1.989057 -1.987225 -0.682151
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.0326796 -0.51071 1.048356 -0.1176455 -0.4487366 0.9474627 -1.303415
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.2516846 -0.6480793 -0.05059287 0.6275672 -0.02957397 1.017001
>
>
> 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: 0xbea49c600>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f6216453"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f7a418849"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f645aaf53"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f7daca59d"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f51ad26e0"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f3ed36604"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f28ceb0d5"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f19bb84e1"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f6610dcf9"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f5d1b93c8"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f3d835f39"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f7be0b6bb"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f5dfcee86"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f88fcf9f"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMf7f1987d41d"
>
>
> ### 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: 0xbea49d0e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xbea49d0e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xbea49d0e0>
> rowMedians(tmp)
[1] 0.764811461 -0.535178420 0.145036624 0.207788147 0.263014719
[6] -0.175488265 -0.304729733 -0.297218483 0.296524325 -0.010330907
[11] 0.152875956 0.346637178 -0.145030788 0.016817904 0.158056396
[16] 0.184467654 -0.004977984 -0.058894230 0.135989172 -0.064174841
[21] -0.027255994 -0.204499201 0.271043717 0.175022259 -0.086530206
[26] 0.351059642 -0.009778140 -0.186130540 0.353604231 0.421939996
[31] -0.126546463 0.194922669 0.054093541 0.114669909 0.269149433
[36] 0.469011153 -0.044151684 0.194246909 0.324727196 -0.084353873
[41] -0.541930090 -0.409254501 0.033241565 0.504332133 0.190212891
[46] 0.224781633 0.360161828 -0.191810118 -0.317393412 0.428768014
[51] -0.039386474 0.669491714 0.221053753 0.427033500 0.050402960
[56] -0.414972604 -0.124383232 -0.261648497 0.092450459 0.274043372
[61] 0.120828887 -0.153660690 -0.128820545 -0.202012617 0.551000635
[66] 0.411151318 0.078857653 -0.152382055 -0.248355919 0.049417674
[71] -0.410427854 -0.221047349 0.333516133 0.128253239 -0.549355091
[76] 0.398812546 0.074328261 -0.097630262 -0.039254000 -0.184595399
[81] 0.039153603 0.409431605 -0.102958584 0.192576903 0.264412955
[86] 0.508744463 -0.102003786 0.499537885 0.306708655 0.241785064
[91] -0.035629438 -0.068083162 0.334272921 -0.415520572 0.057692248
[96] 0.458226086 0.104132779 -0.502544281 -0.049810905 0.369590897
[101] 0.043944115 0.888107348 0.200157949 -0.032532295 0.210255536
[106] -0.743496114 -0.184326256 -0.225082386 -0.310933221 0.051752084
[111] -0.280275905 -0.221734103 0.276058462 0.056226819 -0.161338471
[116] 0.108087394 -0.241558859 0.810388048 0.313903730 0.112730742
[121] 0.188501534 0.646922887 -0.246002199 0.140128360 0.755928676
[126] -0.347003848 -0.037718252 -0.157834324 -0.174450675 -0.031243366
[131] -0.075021893 -0.387307571 -0.123914882 -0.258226974 -0.206055622
[136] 0.643572178 0.127946153 -0.156880708 -0.069174835 -0.108657276
[141] 0.024521205 0.188714048 -0.008530829 0.225919591 -0.015855672
[146] 0.628901877 -0.224689596 0.335367701 -0.132619340 -0.389193491
[151] -0.429459091 -0.040445562 -0.754139001 -0.049330815 0.165357087
[156] -0.141849200 -0.569817450 -0.542445786 -0.886048793 0.017300130
[161] -0.168670527 -0.385434308 0.502311169 -0.045251174 -0.521291148
[166] 0.137613405 0.069325498 -0.370643332 0.151834479 -0.354336077
[171] 0.036036730 -0.124564629 -0.377193035 -0.070285638 -0.094882222
[176] 0.212902010 0.132319391 -0.510752129 0.304598338 0.355008780
[181] 0.078467288 -0.140104624 -0.678743580 -0.534833670 0.037663810
[186] -0.103378809 0.250763173 -0.319669315 -0.176047152 0.263002288
[191] -0.270359861 -0.327540831 0.171471679 -0.187408460 -0.113009142
[196] -0.658697896 0.087802429 -0.149381610 0.183069178 -0.194417427
[201] -0.197309460 0.140914194 0.327382430 -0.157976942 0.261030958
[206] 0.493217108 -0.158879482 0.341234634 -0.176703299 -0.063306303
[211] -0.405167894 -0.871218647 0.059343055 0.240501054 -0.273113845
[216] 0.439973530 -0.355829743 0.118475695 0.270553172 0.291041884
[221] 0.198595782 -0.162650341 0.118680696 -0.299038591 -0.049055261
[226] 0.603023580 -0.191677050 0.043771853 -0.224173364 -0.227233206
>
> proc.time()
user system elapsed
0.795 5.311 6.199
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
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: 0xa41ad8000>
> .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: 0xa41ad8000>
> .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: 0xa41ad8000>
> .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: 0xa41ad8000>
> 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: 0xa41ad8060>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad8060>
> .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: 0xa41ad8060>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad8060>
> .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: 0xa41ad8060>
> 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: 0xa41ad8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad8480>
> .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: 0xa41ad8480>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xa41ad8480>
> .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: 0xa41ad8480>
>
> .Call("R_bm_RowMode",P)
<pointer: 0xa41ad8480>
> .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: 0xa41ad8480>
>
> .Call("R_bm_ColMode",P)
<pointer: 0xa41ad8480>
> .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: 0xa41ad8480>
> 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: 0xa41ad85a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xa41ad85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad85a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11f4429d7a69" "BufferedMatrixFile11f4836c095"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile11f4429d7a69" "BufferedMatrixFile11f4836c095"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad86c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad86c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xa41ad86c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xa41ad86c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xa41ad86c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xa41ad86c0>
> .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: 0xa41ad8840>
> .Call("R_bm_AddColumn",P)
<pointer: 0xa41ad8840>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xa41ad8840>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xa41ad8840>
> 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: 0xa41ad8960>
> .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: 0xa41ad8960>
> rm(P)
>
> proc.time()
user system elapsed
0.121 0.052 0.167
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-03-26 r89717) -- "Unsuffered Consequences"
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.135 0.039 0.168