| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-21 11:38 -0500 (Fri, 21 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4829 |
| lconway | macOS 12.7.6 Monterey | x86_64 | R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" | 4602 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4566 |
| 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 252/2327 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.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: 2025-11-20 19:52:58 -0500 (Thu, 20 Nov 2025) |
| EndedAt: 2025-11-20 19:53:51 -0500 (Thu, 20 Nov 2025) |
| EllapsedTime: 53.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) (2025-10-21 r88958)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/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-x86_64/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) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.337 0.150 0.504
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481268 25.8 1058102 56.6 NA 633897 33.9
Vcells 891509 6.9 8388608 64.0 98304 2110436 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 Nov 20 19:53:24 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 20 19:53:25 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x600001cc8000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Nov 20 19:53:29 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Nov 20 19:53:31 2025"
>
> ColMode(tmp2)
<pointer: 0x600001cc8000>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.0789731 -0.5060114 0.1887822 0.7251765
[2,] -0.3291990 -1.3142696 0.5084867 1.3068329
[3,] 0.7731031 -0.1253947 -1.0713524 0.1332855
[4,] -1.1170823 0.8297996 0.3997337 -0.1612993
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.0789731 0.5060114 0.1887822 0.7251765
[2,] 0.3291990 1.3142696 0.5084867 1.3068329
[3,] 0.7731031 0.1253947 1.0713524 0.1332855
[4,] 1.1170823 0.8297996 0.3997337 0.1612993
> 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.0538039 0.7113448 0.4344908 0.8515730
[2,] 0.5737587 1.1464160 0.7130825 1.1431679
[3,] 0.8792628 0.3541111 1.0350615 0.3650828
[4,] 1.0569212 0.9109333 0.6322450 0.4016208
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.61701 32.61946 29.53369 34.24091
[2,] 31.06679 37.77843 32.63931 37.73851
[3,] 34.56573 28.66651 36.42197 28.78411
[4,] 36.68629 34.93913 31.72218 29.17751
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001cfc120>
> exp(tmp5)
<pointer: 0x600001cfc120>
> log(tmp5,2)
<pointer: 0x600001cfc120>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.6736
> Min(tmp5)
[1] 53.69364
> mean(tmp5)
[1] 72.83454
> Sum(tmp5)
[1] 14566.91
> Var(tmp5)
[1] 882.2382
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.32344 72.22200 69.92611 72.70576 70.31230 69.41898 71.57601 69.15604
[9] 72.60941 71.09536
> rowSums(tmp5)
[1] 1786.469 1444.440 1398.522 1454.115 1406.246 1388.380 1431.520 1383.121
[9] 1452.188 1421.907
> rowVars(tmp5)
[1] 8144.53795 87.24839 77.31471 80.30557 90.39675 78.60693
[7] 81.91581 119.32991 83.06242 63.93085
> rowSd(tmp5)
[1] 90.247094 9.340684 8.792878 8.961337 9.507720 8.866055 9.050735
[8] 10.923823 9.113859 7.995677
> rowMax(tmp5)
[1] 471.67362 90.21728 84.09700 90.24909 86.83680 82.43007 88.04124
[8] 94.89218 86.10536 89.52032
> rowMin(tmp5)
[1] 56.02797 58.18720 55.94263 59.10944 56.52813 55.35780 57.22539 53.69364
[9] 56.12049 59.18080
>
> colMeans(tmp5)
[1] 111.23566 69.05045 75.24359 66.11846 70.10671 72.67512 74.00184
[8] 69.96964 73.20608 69.21363 72.30883 68.27493 70.69232 68.98832
[15] 76.37152 68.58239 72.36418 69.40038 66.51999 72.36680
> colSums(tmp5)
[1] 1112.3566 690.5045 752.4359 661.1846 701.0671 726.7512 740.0184
[8] 699.6964 732.0608 692.1363 723.0883 682.7493 706.9232 689.8832
[15] 763.7152 685.8239 723.6418 694.0038 665.1999 723.6680
> colVars(tmp5)
[1] 16081.76817 43.42835 99.38244 50.28796 114.52153 116.89812
[7] 110.48953 70.76325 68.36901 69.55670 85.71420 38.80062
[13] 133.13841 133.84353 64.97263 62.31088 45.40686 107.13303
[19] 69.90709 59.12125
> colSd(tmp5)
[1] 126.813912 6.590019 9.969074 7.091400 10.701473 10.811943
[7] 10.511400 8.412090 8.268555 8.340066 9.258196 6.229014
[13] 11.538562 11.569076 8.060560 7.893724 6.738461 10.350509
[19] 8.361046 7.689034
> colMax(tmp5)
[1] 471.67362 79.53861 94.89218 78.54777 87.98817 88.04124 90.21728
[8] 82.72358 83.66788 82.43007 83.83564 78.81115 87.81066 85.44080
[15] 89.52032 83.56921 83.11999 90.24909 84.52001 86.10536
> colMin(tmp5)
[1] 58.79001 59.66558 61.47051 56.12049 55.81520 57.32100 53.84205 59.80409
[9] 57.46870 58.06776 58.18720 62.00747 53.69364 53.83785 64.83841 59.10944
[17] 61.57752 55.35780 56.52813 56.75901
>
>
> ### 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] 89.32344 72.22200 69.92611 72.70576 70.31230 69.41898 71.57601 69.15604
[9] 72.60941 NA
> rowSums(tmp5)
[1] 1786.469 1444.440 1398.522 1454.115 1406.246 1388.380 1431.520 1383.121
[9] 1452.188 NA
> rowVars(tmp5)
[1] 8144.53795 87.24839 77.31471 80.30557 90.39675 78.60693
[7] 81.91581 119.32991 83.06242 60.03645
> rowSd(tmp5)
[1] 90.247094 9.340684 8.792878 8.961337 9.507720 8.866055 9.050735
[8] 10.923823 9.113859 7.748319
> rowMax(tmp5)
[1] 471.67362 90.21728 84.09700 90.24909 86.83680 82.43007 88.04124
[8] 94.89218 86.10536 NA
> rowMin(tmp5)
[1] 56.02797 58.18720 55.94263 59.10944 56.52813 55.35780 57.22539 53.69364
[9] 56.12049 NA
>
> colMeans(tmp5)
[1] 111.23566 69.05045 75.24359 66.11846 70.10671 72.67512 NA
[8] 69.96964 73.20608 69.21363 72.30883 68.27493 70.69232 68.98832
[15] 76.37152 68.58239 72.36418 69.40038 66.51999 72.36680
> colSums(tmp5)
[1] 1112.3566 690.5045 752.4359 661.1846 701.0671 726.7512 NA
[8] 699.6964 732.0608 692.1363 723.0883 682.7493 706.9232 689.8832
[15] 763.7152 685.8239 723.6418 694.0038 665.1999 723.6680
> colVars(tmp5)
[1] 16081.76817 43.42835 99.38244 50.28796 114.52153 116.89812
[7] NA 70.76325 68.36901 69.55670 85.71420 38.80062
[13] 133.13841 133.84353 64.97263 62.31088 45.40686 107.13303
[19] 69.90709 59.12125
> colSd(tmp5)
[1] 126.813912 6.590019 9.969074 7.091400 10.701473 10.811943
[7] NA 8.412090 8.268555 8.340066 9.258196 6.229014
[13] 11.538562 11.569076 8.060560 7.893724 6.738461 10.350509
[19] 8.361046 7.689034
> colMax(tmp5)
[1] 471.67362 79.53861 94.89218 78.54777 87.98817 88.04124 NA
[8] 82.72358 83.66788 82.43007 83.83564 78.81115 87.81066 85.44080
[15] 89.52032 83.56921 83.11999 90.24909 84.52001 86.10536
> colMin(tmp5)
[1] 58.79001 59.66558 61.47051 56.12049 55.81520 57.32100 NA 59.80409
[9] 57.46870 58.06776 58.18720 62.00747 53.69364 53.83785 64.83841 59.10944
[17] 61.57752 55.35780 56.52813 56.75901
>
> Max(tmp5,na.rm=TRUE)
[1] 471.6736
> Min(tmp5,na.rm=TRUE)
[1] 53.69364
> mean(tmp5,na.rm=TRUE)
[1] 72.78658
> Sum(tmp5,na.rm=TRUE)
[1] 14484.53
> Var(tmp5,na.rm=TRUE)
[1] 886.2315
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.32344 72.22200 69.92611 72.70576 70.31230 69.41898 71.57601 69.15604
[9] 72.60941 70.50147
> rowSums(tmp5,na.rm=TRUE)
[1] 1786.469 1444.440 1398.522 1454.115 1406.246 1388.380 1431.520 1383.121
[9] 1452.188 1339.528
> rowVars(tmp5,na.rm=TRUE)
[1] 8144.53795 87.24839 77.31471 80.30557 90.39675 78.60693
[7] 81.91581 119.32991 83.06242 60.03645
> rowSd(tmp5,na.rm=TRUE)
[1] 90.247094 9.340684 8.792878 8.961337 9.507720 8.866055 9.050735
[8] 10.923823 9.113859 7.748319
> rowMax(tmp5,na.rm=TRUE)
[1] 471.67362 90.21728 84.09700 90.24909 86.83680 82.43007 88.04124
[8] 94.89218 86.10536 89.52032
> rowMin(tmp5,na.rm=TRUE)
[1] 56.02797 58.18720 55.94263 59.10944 56.52813 55.35780 57.22539 53.69364
[9] 56.12049 59.18080
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.23566 69.05045 75.24359 66.11846 70.10671 72.67512 73.07101
[8] 69.96964 73.20608 69.21363 72.30883 68.27493 70.69232 68.98832
[15] 76.37152 68.58239 72.36418 69.40038 66.51999 72.36680
> colSums(tmp5,na.rm=TRUE)
[1] 1112.3566 690.5045 752.4359 661.1846 701.0671 726.7512 657.6391
[8] 699.6964 732.0608 692.1363 723.0883 682.7493 706.9232 689.8832
[15] 763.7152 685.8239 723.6418 694.0038 665.1999 723.6680
> colVars(tmp5,na.rm=TRUE)
[1] 16081.76817 43.42835 99.38244 50.28796 114.52153 116.89812
[7] 114.55312 70.76325 68.36901 69.55670 85.71420 38.80062
[13] 133.13841 133.84353 64.97263 62.31088 45.40686 107.13303
[19] 69.90709 59.12125
> colSd(tmp5,na.rm=TRUE)
[1] 126.813912 6.590019 9.969074 7.091400 10.701473 10.811943
[7] 10.702949 8.412090 8.268555 8.340066 9.258196 6.229014
[13] 11.538562 11.569076 8.060560 7.893724 6.738461 10.350509
[19] 8.361046 7.689034
> colMax(tmp5,na.rm=TRUE)
[1] 471.67362 79.53861 94.89218 78.54777 87.98817 88.04124 90.21728
[8] 82.72358 83.66788 82.43007 83.83564 78.81115 87.81066 85.44080
[15] 89.52032 83.56921 83.11999 90.24909 84.52001 86.10536
> colMin(tmp5,na.rm=TRUE)
[1] 58.79001 59.66558 61.47051 56.12049 55.81520 57.32100 53.84205 59.80409
[9] 57.46870 58.06776 58.18720 62.00747 53.69364 53.83785 64.83841 59.10944
[17] 61.57752 55.35780 56.52813 56.75901
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.32344 72.22200 69.92611 72.70576 70.31230 69.41898 71.57601 69.15604
[9] 72.60941 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1786.469 1444.440 1398.522 1454.115 1406.246 1388.380 1431.520 1383.121
[9] 1452.188 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 8144.53795 87.24839 77.31471 80.30557 90.39675 78.60693
[7] 81.91581 119.32991 83.06242 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 90.247094 9.340684 8.792878 8.961337 9.507720 8.866055 9.050735
[8] 10.923823 9.113859 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 471.67362 90.21728 84.09700 90.24909 86.83680 82.43007 88.04124
[8] 94.89218 86.10536 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 56.02797 58.18720 55.94263 59.10944 56.52813 55.35780 57.22539 53.69364
[9] 56.12049 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.26310 69.52712 74.77123 66.17919 70.41063 73.24034 NaN
[8] 69.48522 73.33126 68.51312 73.57341 68.57366 69.91727 69.75751
[15] 74.91054 68.43872 72.25088 70.22958 67.33545 71.77643
> colSums(tmp5,na.rm=TRUE)
[1] 1037.3679 625.7441 672.9411 595.6128 633.6957 659.1630 0.0000
[8] 625.3670 659.9813 616.6181 662.1607 617.1629 629.2554 627.8176
[15] 674.1949 615.9484 650.2580 632.0662 606.0191 645.9878
> colVars(tmp5,na.rm=TRUE)
[1] 17909.51081 46.30073 109.29512 56.53246 127.79757 127.91635
[7] NA 76.96869 76.73884 72.73082 78.43763 42.64677
[13] 143.02285 143.91787 49.08157 69.86750 50.93832 112.78957
[19] 71.16442 62.59032
> colSd(tmp5,na.rm=TRUE)
[1] 133.826420 6.804464 10.454431 7.518807 11.304759 11.310011
[7] NA 8.773180 8.760071 8.528237 8.856502 6.530450
[13] 11.959216 11.996577 7.005824 8.358678 7.137109 10.620244
[19] 8.435901 7.911404
> colMax(tmp5,na.rm=TRUE)
[1] 471.67362 79.53861 94.89218 78.54777 87.98817 88.04124 -Inf
[8] 82.72358 83.66788 82.43007 83.83564 78.81115 87.81066 85.44080
[15] 85.38756 83.56921 83.11999 90.24909 84.52001 86.10536
> colMin(tmp5,na.rm=TRUE)
[1] 58.79001 59.66558 61.47051 56.12049 55.81520 57.32100 Inf 59.80409
[9] 57.46870 58.06776 58.18720 62.00747 53.69364 53.83785 64.83841 59.10944
[17] 61.57752 55.35780 56.52813 56.75901
>
>
>
>
> 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] 284.0251 118.0445 296.6806 174.6018 193.9267 267.9061 148.8669 155.4379
[9] 181.3198 185.3269
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 284.0251 118.0445 296.6806 174.6018 193.9267 267.9061 148.8669 155.4379
[9] 181.3198 185.3269
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 0.000000e+00 5.684342e-14 -1.421085e-14 2.842171e-14 1.705303e-13
[6] -8.526513e-14 -5.684342e-14 -1.421085e-14 -1.136868e-13 0.000000e+00
[11] -8.526513e-14 2.842171e-14 -2.842171e-14 -1.136868e-13 8.526513e-14
[16] 0.000000e+00 -3.979039e-13 5.684342e-14 5.684342e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
2 1
6 11
5 14
6 19
5 3
9 4
5 4
8 5
3 19
9 19
2 9
9 3
5 9
4 14
2 10
7 17
7 20
1 8
1 3
5 7
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 1.706384
> Min(tmp)
[1] -2.0637
> mean(tmp)
[1] 0.1055945
> Sum(tmp)
[1] 10.55945
> Var(tmp)
[1] 0.8754242
>
> rowMeans(tmp)
[1] 0.1055945
> rowSums(tmp)
[1] 10.55945
> rowVars(tmp)
[1] 0.8754242
> rowSd(tmp)
[1] 0.9356411
> rowMax(tmp)
[1] 1.706384
> rowMin(tmp)
[1] -2.0637
>
> colMeans(tmp)
[1] 0.06883355 -0.47329436 0.11602788 0.51159111 1.04195306 -0.22549936
[7] -0.83509894 0.43127167 -0.41052545 1.70638414 -2.06327887 0.58112160
[13] -0.56404873 0.67645710 0.05499670 1.10915706 1.51532098 -0.57789931
[19] 0.06280459 -2.06370013 0.35356968 1.27550543 0.99320158 0.15423759
[25] -1.08564949 0.70247764 0.73987151 0.87136472 0.89296361 -0.77120862
[31] -0.11083696 1.47903895 0.93544948 1.59349932 0.52929886 0.22048650
[37] -0.43089484 -0.74839089 0.83722376 1.30155799 0.68544227 -1.06877472
[43] 1.10011602 -0.74419200 1.05285950 -0.33281792 0.27586788 1.13957997
[49] 0.83466740 -0.84127404 -0.40055178 -0.30133829 -0.18284348 -0.32210904
[55] -2.05098452 -0.29737212 -1.89499496 -1.25327034 -0.67738363 1.01199709
[61] -0.73146720 0.05458391 1.02257033 -1.56554666 -0.09900183 -1.55609027
[67] -0.48988080 0.64890429 1.13611239 -1.33153359 -0.54498434 0.58264338
[73] 0.72976517 -1.09600116 0.58058177 -0.73774977 0.81683240 -0.71483686
[79] -0.54850149 -0.47372198 1.58505236 0.59047523 0.56079820 0.17251155
[85] -0.77008769 1.56669188 -0.19804477 0.75399199 -1.21939535 1.03381056
[91] 0.07861014 1.31025129 0.89231849 -0.08594294 1.67604099 -0.52261844
[97] 1.21128412 -1.02814651 0.11487978 1.02633195
> colSums(tmp)
[1] 0.06883355 -0.47329436 0.11602788 0.51159111 1.04195306 -0.22549936
[7] -0.83509894 0.43127167 -0.41052545 1.70638414 -2.06327887 0.58112160
[13] -0.56404873 0.67645710 0.05499670 1.10915706 1.51532098 -0.57789931
[19] 0.06280459 -2.06370013 0.35356968 1.27550543 0.99320158 0.15423759
[25] -1.08564949 0.70247764 0.73987151 0.87136472 0.89296361 -0.77120862
[31] -0.11083696 1.47903895 0.93544948 1.59349932 0.52929886 0.22048650
[37] -0.43089484 -0.74839089 0.83722376 1.30155799 0.68544227 -1.06877472
[43] 1.10011602 -0.74419200 1.05285950 -0.33281792 0.27586788 1.13957997
[49] 0.83466740 -0.84127404 -0.40055178 -0.30133829 -0.18284348 -0.32210904
[55] -2.05098452 -0.29737212 -1.89499496 -1.25327034 -0.67738363 1.01199709
[61] -0.73146720 0.05458391 1.02257033 -1.56554666 -0.09900183 -1.55609027
[67] -0.48988080 0.64890429 1.13611239 -1.33153359 -0.54498434 0.58264338
[73] 0.72976517 -1.09600116 0.58058177 -0.73774977 0.81683240 -0.71483686
[79] -0.54850149 -0.47372198 1.58505236 0.59047523 0.56079820 0.17251155
[85] -0.77008769 1.56669188 -0.19804477 0.75399199 -1.21939535 1.03381056
[91] 0.07861014 1.31025129 0.89231849 -0.08594294 1.67604099 -0.52261844
[97] 1.21128412 -1.02814651 0.11487978 1.02633195
> 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.06883355 -0.47329436 0.11602788 0.51159111 1.04195306 -0.22549936
[7] -0.83509894 0.43127167 -0.41052545 1.70638414 -2.06327887 0.58112160
[13] -0.56404873 0.67645710 0.05499670 1.10915706 1.51532098 -0.57789931
[19] 0.06280459 -2.06370013 0.35356968 1.27550543 0.99320158 0.15423759
[25] -1.08564949 0.70247764 0.73987151 0.87136472 0.89296361 -0.77120862
[31] -0.11083696 1.47903895 0.93544948 1.59349932 0.52929886 0.22048650
[37] -0.43089484 -0.74839089 0.83722376 1.30155799 0.68544227 -1.06877472
[43] 1.10011602 -0.74419200 1.05285950 -0.33281792 0.27586788 1.13957997
[49] 0.83466740 -0.84127404 -0.40055178 -0.30133829 -0.18284348 -0.32210904
[55] -2.05098452 -0.29737212 -1.89499496 -1.25327034 -0.67738363 1.01199709
[61] -0.73146720 0.05458391 1.02257033 -1.56554666 -0.09900183 -1.55609027
[67] -0.48988080 0.64890429 1.13611239 -1.33153359 -0.54498434 0.58264338
[73] 0.72976517 -1.09600116 0.58058177 -0.73774977 0.81683240 -0.71483686
[79] -0.54850149 -0.47372198 1.58505236 0.59047523 0.56079820 0.17251155
[85] -0.77008769 1.56669188 -0.19804477 0.75399199 -1.21939535 1.03381056
[91] 0.07861014 1.31025129 0.89231849 -0.08594294 1.67604099 -0.52261844
[97] 1.21128412 -1.02814651 0.11487978 1.02633195
> colMin(tmp)
[1] 0.06883355 -0.47329436 0.11602788 0.51159111 1.04195306 -0.22549936
[7] -0.83509894 0.43127167 -0.41052545 1.70638414 -2.06327887 0.58112160
[13] -0.56404873 0.67645710 0.05499670 1.10915706 1.51532098 -0.57789931
[19] 0.06280459 -2.06370013 0.35356968 1.27550543 0.99320158 0.15423759
[25] -1.08564949 0.70247764 0.73987151 0.87136472 0.89296361 -0.77120862
[31] -0.11083696 1.47903895 0.93544948 1.59349932 0.52929886 0.22048650
[37] -0.43089484 -0.74839089 0.83722376 1.30155799 0.68544227 -1.06877472
[43] 1.10011602 -0.74419200 1.05285950 -0.33281792 0.27586788 1.13957997
[49] 0.83466740 -0.84127404 -0.40055178 -0.30133829 -0.18284348 -0.32210904
[55] -2.05098452 -0.29737212 -1.89499496 -1.25327034 -0.67738363 1.01199709
[61] -0.73146720 0.05458391 1.02257033 -1.56554666 -0.09900183 -1.55609027
[67] -0.48988080 0.64890429 1.13611239 -1.33153359 -0.54498434 0.58264338
[73] 0.72976517 -1.09600116 0.58058177 -0.73774977 0.81683240 -0.71483686
[79] -0.54850149 -0.47372198 1.58505236 0.59047523 0.56079820 0.17251155
[85] -0.77008769 1.56669188 -0.19804477 0.75399199 -1.21939535 1.03381056
[91] 0.07861014 1.31025129 0.89231849 -0.08594294 1.67604099 -0.52261844
[97] 1.21128412 -1.02814651 0.11487978 1.02633195
> colMedians(tmp)
[1] 0.06883355 -0.47329436 0.11602788 0.51159111 1.04195306 -0.22549936
[7] -0.83509894 0.43127167 -0.41052545 1.70638414 -2.06327887 0.58112160
[13] -0.56404873 0.67645710 0.05499670 1.10915706 1.51532098 -0.57789931
[19] 0.06280459 -2.06370013 0.35356968 1.27550543 0.99320158 0.15423759
[25] -1.08564949 0.70247764 0.73987151 0.87136472 0.89296361 -0.77120862
[31] -0.11083696 1.47903895 0.93544948 1.59349932 0.52929886 0.22048650
[37] -0.43089484 -0.74839089 0.83722376 1.30155799 0.68544227 -1.06877472
[43] 1.10011602 -0.74419200 1.05285950 -0.33281792 0.27586788 1.13957997
[49] 0.83466740 -0.84127404 -0.40055178 -0.30133829 -0.18284348 -0.32210904
[55] -2.05098452 -0.29737212 -1.89499496 -1.25327034 -0.67738363 1.01199709
[61] -0.73146720 0.05458391 1.02257033 -1.56554666 -0.09900183 -1.55609027
[67] -0.48988080 0.64890429 1.13611239 -1.33153359 -0.54498434 0.58264338
[73] 0.72976517 -1.09600116 0.58058177 -0.73774977 0.81683240 -0.71483686
[79] -0.54850149 -0.47372198 1.58505236 0.59047523 0.56079820 0.17251155
[85] -0.77008769 1.56669188 -0.19804477 0.75399199 -1.21939535 1.03381056
[91] 0.07861014 1.31025129 0.89231849 -0.08594294 1.67604099 -0.52261844
[97] 1.21128412 -1.02814651 0.11487978 1.02633195
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.06883355 -0.4732944 0.1160279 0.5115911 1.041953 -0.2254994 -0.8350989
[2,] 0.06883355 -0.4732944 0.1160279 0.5115911 1.041953 -0.2254994 -0.8350989
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.4312717 -0.4105254 1.706384 -2.063279 0.5811216 -0.5640487 0.6764571
[2,] 0.4312717 -0.4105254 1.706384 -2.063279 0.5811216 -0.5640487 0.6764571
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.0549967 1.109157 1.515321 -0.5778993 0.06280459 -2.0637 0.3535697
[2,] 0.0549967 1.109157 1.515321 -0.5778993 0.06280459 -2.0637 0.3535697
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.275505 0.9932016 0.1542376 -1.085649 0.7024776 0.7398715 0.8713647
[2,] 1.275505 0.9932016 0.1542376 -1.085649 0.7024776 0.7398715 0.8713647
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.8929636 -0.7712086 -0.110837 1.479039 0.9354495 1.593499 0.5292989
[2,] 0.8929636 -0.7712086 -0.110837 1.479039 0.9354495 1.593499 0.5292989
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.2204865 -0.4308948 -0.7483909 0.8372238 1.301558 0.6854423 -1.068775
[2,] 0.2204865 -0.4308948 -0.7483909 0.8372238 1.301558 0.6854423 -1.068775
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.100116 -0.744192 1.05286 -0.3328179 0.2758679 1.13958 0.8346674
[2,] 1.100116 -0.744192 1.05286 -0.3328179 0.2758679 1.13958 0.8346674
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.841274 -0.4005518 -0.3013383 -0.1828435 -0.322109 -2.050985 -0.2973721
[2,] -0.841274 -0.4005518 -0.3013383 -0.1828435 -0.322109 -2.050985 -0.2973721
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.894995 -1.25327 -0.6773836 1.011997 -0.7314672 0.05458391 1.02257
[2,] -1.894995 -1.25327 -0.6773836 1.011997 -0.7314672 0.05458391 1.02257
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.565547 -0.09900183 -1.55609 -0.4898808 0.6489043 1.136112 -1.331534
[2,] -1.565547 -0.09900183 -1.55609 -0.4898808 0.6489043 1.136112 -1.331534
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.5449843 0.5826434 0.7297652 -1.096001 0.5805818 -0.7377498 0.8168324
[2,] -0.5449843 0.5826434 0.7297652 -1.096001 0.5805818 -0.7377498 0.8168324
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.7148369 -0.5485015 -0.473722 1.585052 0.5904752 0.5607982 0.1725116
[2,] -0.7148369 -0.5485015 -0.473722 1.585052 0.5904752 0.5607982 0.1725116
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.7700877 1.566692 -0.1980448 0.753992 -1.219395 1.033811 0.07861014
[2,] -0.7700877 1.566692 -0.1980448 0.753992 -1.219395 1.033811 0.07861014
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.310251 0.8923185 -0.08594294 1.676041 -0.5226184 1.211284 -1.028147
[2,] 1.310251 0.8923185 -0.08594294 1.676041 -0.5226184 1.211284 -1.028147
[,99] [,100]
[1,] 0.1148798 1.026332
[2,] 0.1148798 1.026332
>
>
> Max(tmp2)
[1] 2.123207
> Min(tmp2)
[1] -2.640051
> mean(tmp2)
[1] -0.05334749
> Sum(tmp2)
[1] -5.334749
> Var(tmp2)
[1] 0.9964926
>
> rowMeans(tmp2)
[1] 0.934220549 0.371758779 -0.191330475 -0.611896680 1.091011925
[6] -0.423860674 -0.129112137 -1.470355723 -0.883940683 0.211536886
[11] -0.926177411 -0.247821676 1.125260154 0.938635988 0.432614900
[16] -0.797842126 -0.544366163 -0.899276639 0.250236635 0.442116252
[21] -0.839044730 -1.103945016 -0.394400025 -1.075238276 1.149886688
[26] 0.737361579 -1.695331531 0.831463059 -0.378554015 -2.145436683
[31] 0.870964867 -0.871424979 -0.920361164 0.156461176 -1.713778807
[36] -1.583402640 0.007466326 -0.556403142 0.568177965 -0.460796352
[41] -1.298663655 -0.088549188 -0.060006853 -0.799877975 0.273156943
[46] -0.324693929 0.478639216 0.338802073 0.529543715 1.982518551
[51] -0.389154968 0.032168839 -0.035846143 0.098821545 1.096818864
[56] 1.240828454 -0.398297805 0.470491747 0.507325733 -0.301098889
[61] 1.302660494 1.435099391 -0.756499486 1.375218757 0.198999169
[66] -0.888151316 2.052798277 0.047184148 -0.864269290 -1.321875724
[71] -1.168815324 -0.145310120 0.538844533 -1.148737172 2.003780661
[76] -2.640051495 -0.829885272 0.337838779 1.535936457 -0.109340677
[81] -0.550975034 -0.186235741 -1.192414307 -0.531478253 -0.796726431
[86] 0.093905452 -0.778825136 0.011428533 1.159416421 -0.132109680
[91] -0.206252933 0.858755733 0.220060600 2.123206561 -2.353101153
[96] -1.088856109 1.308370969 1.287943330 -0.160490559 2.016201993
> rowSums(tmp2)
[1] 0.934220549 0.371758779 -0.191330475 -0.611896680 1.091011925
[6] -0.423860674 -0.129112137 -1.470355723 -0.883940683 0.211536886
[11] -0.926177411 -0.247821676 1.125260154 0.938635988 0.432614900
[16] -0.797842126 -0.544366163 -0.899276639 0.250236635 0.442116252
[21] -0.839044730 -1.103945016 -0.394400025 -1.075238276 1.149886688
[26] 0.737361579 -1.695331531 0.831463059 -0.378554015 -2.145436683
[31] 0.870964867 -0.871424979 -0.920361164 0.156461176 -1.713778807
[36] -1.583402640 0.007466326 -0.556403142 0.568177965 -0.460796352
[41] -1.298663655 -0.088549188 -0.060006853 -0.799877975 0.273156943
[46] -0.324693929 0.478639216 0.338802073 0.529543715 1.982518551
[51] -0.389154968 0.032168839 -0.035846143 0.098821545 1.096818864
[56] 1.240828454 -0.398297805 0.470491747 0.507325733 -0.301098889
[61] 1.302660494 1.435099391 -0.756499486 1.375218757 0.198999169
[66] -0.888151316 2.052798277 0.047184148 -0.864269290 -1.321875724
[71] -1.168815324 -0.145310120 0.538844533 -1.148737172 2.003780661
[76] -2.640051495 -0.829885272 0.337838779 1.535936457 -0.109340677
[81] -0.550975034 -0.186235741 -1.192414307 -0.531478253 -0.796726431
[86] 0.093905452 -0.778825136 0.011428533 1.159416421 -0.132109680
[91] -0.206252933 0.858755733 0.220060600 2.123206561 -2.353101153
[96] -1.088856109 1.308370969 1.287943330 -0.160490559 2.016201993
> 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.934220549 0.371758779 -0.191330475 -0.611896680 1.091011925
[6] -0.423860674 -0.129112137 -1.470355723 -0.883940683 0.211536886
[11] -0.926177411 -0.247821676 1.125260154 0.938635988 0.432614900
[16] -0.797842126 -0.544366163 -0.899276639 0.250236635 0.442116252
[21] -0.839044730 -1.103945016 -0.394400025 -1.075238276 1.149886688
[26] 0.737361579 -1.695331531 0.831463059 -0.378554015 -2.145436683
[31] 0.870964867 -0.871424979 -0.920361164 0.156461176 -1.713778807
[36] -1.583402640 0.007466326 -0.556403142 0.568177965 -0.460796352
[41] -1.298663655 -0.088549188 -0.060006853 -0.799877975 0.273156943
[46] -0.324693929 0.478639216 0.338802073 0.529543715 1.982518551
[51] -0.389154968 0.032168839 -0.035846143 0.098821545 1.096818864
[56] 1.240828454 -0.398297805 0.470491747 0.507325733 -0.301098889
[61] 1.302660494 1.435099391 -0.756499486 1.375218757 0.198999169
[66] -0.888151316 2.052798277 0.047184148 -0.864269290 -1.321875724
[71] -1.168815324 -0.145310120 0.538844533 -1.148737172 2.003780661
[76] -2.640051495 -0.829885272 0.337838779 1.535936457 -0.109340677
[81] -0.550975034 -0.186235741 -1.192414307 -0.531478253 -0.796726431
[86] 0.093905452 -0.778825136 0.011428533 1.159416421 -0.132109680
[91] -0.206252933 0.858755733 0.220060600 2.123206561 -2.353101153
[96] -1.088856109 1.308370969 1.287943330 -0.160490559 2.016201993
> rowMin(tmp2)
[1] 0.934220549 0.371758779 -0.191330475 -0.611896680 1.091011925
[6] -0.423860674 -0.129112137 -1.470355723 -0.883940683 0.211536886
[11] -0.926177411 -0.247821676 1.125260154 0.938635988 0.432614900
[16] -0.797842126 -0.544366163 -0.899276639 0.250236635 0.442116252
[21] -0.839044730 -1.103945016 -0.394400025 -1.075238276 1.149886688
[26] 0.737361579 -1.695331531 0.831463059 -0.378554015 -2.145436683
[31] 0.870964867 -0.871424979 -0.920361164 0.156461176 -1.713778807
[36] -1.583402640 0.007466326 -0.556403142 0.568177965 -0.460796352
[41] -1.298663655 -0.088549188 -0.060006853 -0.799877975 0.273156943
[46] -0.324693929 0.478639216 0.338802073 0.529543715 1.982518551
[51] -0.389154968 0.032168839 -0.035846143 0.098821545 1.096818864
[56] 1.240828454 -0.398297805 0.470491747 0.507325733 -0.301098889
[61] 1.302660494 1.435099391 -0.756499486 1.375218757 0.198999169
[66] -0.888151316 2.052798277 0.047184148 -0.864269290 -1.321875724
[71] -1.168815324 -0.145310120 0.538844533 -1.148737172 2.003780661
[76] -2.640051495 -0.829885272 0.337838779 1.535936457 -0.109340677
[81] -0.550975034 -0.186235741 -1.192414307 -0.531478253 -0.796726431
[86] 0.093905452 -0.778825136 0.011428533 1.159416421 -0.132109680
[91] -0.206252933 0.858755733 0.220060600 2.123206561 -2.353101153
[96] -1.088856109 1.308370969 1.287943330 -0.160490559 2.016201993
>
> colMeans(tmp2)
[1] -0.05334749
> colSums(tmp2)
[1] -5.334749
> colVars(tmp2)
[1] 0.9964926
> colSd(tmp2)
[1] 0.9982448
> colMax(tmp2)
[1] 2.123207
> colMin(tmp2)
[1] -2.640051
> colMedians(tmp2)
[1] -0.1192264
> colRanges(tmp2)
[,1]
[1,] -2.640051
[2,] 2.123207
>
> 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.07784738 5.15833798 -5.94951426 4.78157037 4.18465856 -2.46852271
[7] -1.56897731 4.18951908 -5.61755377 0.03841860
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8095329
[2,] -0.3274601
[3,] -0.1101922
[4,] 0.1968222
[5,] 1.4762432
>
> rowApply(tmp,sum)
[1] -0.05500747 -2.68149882 2.93835303 -3.71767444 3.89775782 1.61775046
[7] 0.31343649 -0.82021681 0.91103137 0.42185228
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 7 5 3 4 3 4 4 6 9
[2,] 5 10 7 4 10 10 9 2 5 7
[3,] 3 2 3 1 1 8 5 6 7 2
[4,] 8 6 4 6 5 9 3 3 10 10
[5,] 7 4 10 7 9 2 6 10 3 8
[6,] 4 1 8 8 2 7 7 7 8 6
[7,] 9 5 2 9 7 1 1 8 4 1
[8,] 2 8 9 10 6 5 10 9 9 5
[9,] 1 9 6 5 3 4 2 1 1 4
[10,] 10 3 1 2 8 6 8 5 2 3
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.26115756 4.20477696 2.92122562 0.99157683 -1.26381251 0.43271470
[7] -3.46639986 -0.44693356 -5.11415115 -0.03125202 -0.25042625 -1.80551138
[13] -0.44692296 2.46981986 -0.44000934 0.07666554 -2.18561576 -3.11228041
[19] -0.49010224 0.32897189
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.6787254
[2,] -0.5244649
[3,] -0.3886868
[4,] -0.2753358
[5,] 0.6060553
>
> rowApply(tmp,sum)
[1] 1.031644 -6.545405 -1.877006 -3.641680 2.143624
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 7 12 5 16 7
[2,] 19 15 20 20 10
[3,] 18 14 4 11 20
[4,] 14 18 2 10 14
[5,] 9 10 8 18 2
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.3886868 1.5446359 1.4537254 0.8929391 -0.1348937 -1.1395928
[2,] -0.2753358 0.4039085 -0.2251527 0.5595291 -0.3275440 0.5350385
[3,] -0.6787254 1.3547800 -0.6854173 -0.8182769 -0.4591611 0.6103791
[4,] 0.6060553 1.0666006 -0.1249453 -0.1943192 0.7945668 0.6704247
[5,] -0.5244649 -0.1651480 2.5030156 0.5517048 -1.1367806 -0.2435348
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -2.6276255 1.0802323 0.5240498 -0.5932653 0.04257217 1.9960139
[2,] 1.2626418 -0.2572015 -1.6888043 -0.5929645 -0.44161379 -2.0541924
[3,] 0.1544487 0.6407873 -0.7720930 -0.2121574 -0.64031479 0.5322645
[4,] -1.2244016 -1.3252486 -1.6891548 -0.4151129 0.32854463 -1.2664930
[5,] -1.0314632 -0.5855031 -1.4881488 1.7822480 0.46038553 -1.0131044
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.1411407 0.9481343 -0.3715549 1.3387708 -0.76251341 -1.5270145
[2,] -0.3128460 1.6482499 -0.4952645 -1.3526871 -0.93947269 -1.8288548
[3,] 1.1319602 -0.9005197 -0.0241072 -0.5551917 -0.16812012 -0.2099654
[4,] -0.4063137 0.1182152 -0.2846993 0.3283859 0.04455397 -0.9370549
[5,] 0.2814172 0.6557402 0.7356165 0.3173877 -0.36006351 1.3906091
[,19] [,20]
[1,] -0.08694479 -0.01619718
[2,] -0.64078512 0.47794651
[3,] 0.25046819 -0.42804403
[4,] 0.92929833 -0.66058260
[5,] -0.94213885 0.95584920
>
>
> 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 : 653 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.9618587 -0.9617522 -0.6359878 -1.009469 -0.3164725 -0.4203759 0.2891221
col8 col9 col10 col11 col12 col13 col14
row1 0.9679 -1.169437 0.6020449 -1.911367 -0.1955216 -0.6706064 -0.7296702
col15 col16 col17 col18 col19 col20
row1 0.1936193 -0.1489515 -0.4414992 0.6907787 -1.102032 -2.108913
> tmp[,"col10"]
col10
row1 0.6020449
row2 0.5060594
row3 1.2030805
row4 0.1417764
row5 -1.2103283
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.9618587 -0.9617522 -0.6359878 -1.009469 -0.3164725 -0.4203759
row5 0.8118560 -1.6838114 -1.2458774 -1.678254 0.4997326 -0.8993136
col7 col8 col9 col10 col11 col12
row1 0.2891221 0.9679000 -1.1694367 0.6020449 -1.911367 -0.19552165
row5 -0.2144840 -0.1453374 -0.8313057 -1.2103283 -1.242752 -0.02307378
col13 col14 col15 col16 col17 col18
row1 -0.6706064 -0.7296702 0.1936193 -0.1489515 -0.4414992 0.6907787
row5 0.8419432 -0.7117983 -1.2009248 -1.5313666 0.1594491 -1.2685288
col19 col20
row1 -1.1020323 -2.108913
row5 -0.2569486 -1.313456
> tmp[,c("col6","col20")]
col6 col20
row1 -0.42037590 -2.10891318
row2 0.05614015 -0.04266919
row3 1.29345328 1.09529485
row4 -0.42661286 0.04433761
row5 -0.89931364 -1.31345633
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.4203759 -2.108913
row5 -0.8993136 -1.313456
>
>
>
>
> 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 48.15717 48.93635 51.06236 51.62687 51.17261 102.6132 50.57105 48.24321
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.01451 50.8445 50.36491 50.28218 49.52322 51.2361 50.09916 51.2533
col17 col18 col19 col20
row1 50.21553 50.20936 50.39483 104.9217
> tmp[,"col10"]
col10
row1 50.84450
row2 31.56027
row3 31.20948
row4 30.96535
row5 52.04253
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.15717 48.93635 51.06236 51.62687 51.17261 102.6132 50.57105 48.24321
row5 48.75419 48.42628 51.95219 51.78441 50.21004 104.5050 50.37489 48.03895
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.01451 50.84450 50.36491 50.28218 49.52322 51.23610 50.09916 51.25330
row5 49.69602 52.04253 51.73595 51.10836 49.46736 49.67849 50.48184 49.72191
col17 col18 col19 col20
row1 50.21553 50.20936 50.39483 104.9217
row5 50.29356 48.61157 50.15126 103.9387
> tmp[,c("col6","col20")]
col6 col20
row1 102.61323 104.92169
row2 74.97778 75.23940
row3 75.47652 75.69670
row4 74.83751 74.06466
row5 104.50502 103.93870
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 102.6132 104.9217
row5 104.5050 103.9387
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 102.6132 104.9217
row5 104.5050 103.9387
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.08443882
[2,] 0.92214247
[3,] 1.28772427
[4,] 0.55179387
[5,] 0.81428013
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.2054131 0.9125457
[2,] 0.3120966 -0.2233604
[3,] 0.4876558 0.9761169
[4,] 0.5580835 1.1526224
[5,] 1.1587460 -1.8821876
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 2.9088861 -1.0465887
[2,] 0.1056262 -0.8683860
[3,] 1.0273605 0.7315447
[4,] 0.8658616 -1.1123292
[5,] 0.1561570 -1.1459309
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 2.908886
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 2.9088861
[2,] 0.1056262
>
>
>
> 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.8307961 -1.418244 -0.9764179 0.1052819 1.784937 0.09700840 -1.8595904
row1 0.3926729 1.284940 -0.5452301 2.5530538 -1.426297 0.04240035 -0.4829458
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.2513939 1.101461 2.3310379 -2.1940880 0.6625721 -0.3017494
row1 0.9306143 -1.593813 -0.1598161 0.9213741 -1.5124457 1.6207744
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.8349027 1.1750139 0.04636084 -1.2060061 -0.8976697 -1.972252
row1 0.5688864 0.5001066 -0.38232873 -0.3571989 -0.2192624 1.054075
[,20]
row3 0.3375631
row1 -1.1084494
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.516406 0.1375746 -0.1058246 1.125538 1.956768 0.7981359 -0.8748479
[,8] [,9] [,10]
row2 -1.32884 0.03703718 -0.4807328
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.8640659 -0.9392492 -0.8512817 -0.5392337 -0.4908996 -0.4978512 0.632974
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3817167 -0.5712982 -1.195762 0.5339532 -0.8259724 -1.683134 0.4458385
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.03937311 -2.130425 1.403236 0.06725066 0.3578561 -1.263487
>
>
> 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: 0x600001ca8000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec940703ea8"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9921a8a5"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9c6ed52"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9406a2e4"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec94fb028cc"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9364691f3"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec95318045b"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec94dc61cfb"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9998caa1"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9e1f14f3"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec91a9864c3"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec9aff4bd9"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec97ecc9932"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec92a5de2a7"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13ec979cb57ab"
>
>
> ### 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: 0x600001cc8060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001cc8060>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600001cc8060>
> rowMedians(tmp)
[1] -0.511241258 -0.105614344 0.020490618 -0.341885745 0.199890225
[6] -0.382475868 0.233543058 -0.174266932 -0.576307146 0.376658662
[11] 0.003817353 0.318931448 0.030379944 0.086414103 0.314871284
[16] 0.535907584 -0.679222831 -0.479347075 -0.502478229 0.188404638
[21] 0.346525511 0.663299508 -0.102330275 -0.099891360 0.089954573
[26] -0.035053077 0.092787321 -0.442608128 -0.027308272 -0.421090791
[31] 0.194164073 -0.373150083 -0.244441816 -0.129655827 0.210109010
[36] -0.681710606 0.168806670 -0.256319608 -0.040034050 0.117421028
[41] -0.059870368 0.162881405 0.439950456 -0.042342227 0.091292529
[46] -0.225402962 -0.233551101 -0.102126972 0.067736703 0.278053684
[51] -0.249953534 0.263440629 0.350401785 0.419803883 0.137216700
[56] 0.284494329 0.266505182 -0.065741179 -0.072990539 0.037659345
[61] -0.657429364 0.169374325 -0.254469934 0.075636202 0.454464365
[66] -0.425700657 -0.015773319 0.308351727 -0.058893091 -0.158959059
[71] 0.109100176 0.556759186 -0.032570089 -0.497061790 -0.457248400
[76] 0.118390299 -0.117428709 -0.009188836 0.088249663 0.309693660
[81] -0.372482865 0.455952769 -0.344470927 0.109317911 -0.153190957
[86] 0.318418633 -0.042601183 -0.184544677 0.123696084 0.325349531
[91] 0.403179274 -0.278392926 0.038676301 -0.067938373 -0.226327074
[96] 0.258305625 0.367901644 -0.005654588 0.144309216 -0.195958537
[101] 0.265537946 -0.006586991 -0.301215175 -0.121998705 0.378841091
[106] -0.184392894 0.448403634 0.176146407 -0.427365496 0.114460715
[111] 0.330786500 -0.518115838 0.040174306 -0.245448042 0.043493911
[116] 0.319433444 0.017393978 0.191973829 0.122271101 -0.034833064
[121] 0.017405581 0.061688382 -0.215565834 -0.410215706 0.015536854
[126] 0.331838842 -0.139822489 0.213952389 -0.038638515 0.218077986
[131] -0.179075711 -0.229511383 0.146974869 0.459218873 -0.071999918
[136] 0.438553390 0.280281314 0.014906153 -0.078679691 0.221466759
[141] -0.128739505 0.303734935 0.309579899 0.019518260 -0.141886982
[146] 0.251208299 -0.080068407 -0.338129886 0.059081334 -0.057005972
[151] -0.222373739 -0.354635525 0.255851016 -0.440708673 0.517795735
[156] 0.023650801 0.774905698 -0.097071193 0.263826284 0.281391061
[161] -0.422533980 -0.427423730 0.141187426 -0.507909544 0.442716154
[166] -0.233852343 -0.014318950 0.551550064 -0.115021081 -0.065753829
[171] 0.339701870 -0.281856331 -0.195717105 0.202905341 -0.269076675
[176] -0.551612879 0.141014486 0.038106066 0.498681562 -0.098976953
[181] 0.225702762 -0.157519513 0.085077364 -0.298696781 0.202664705
[186] 0.007468739 -0.236171341 0.066203618 0.554803323 -0.112230831
[191] 0.443957827 0.093899975 -0.410724996 -0.554375907 0.220233690
[196] 0.022492189 -0.021052762 0.358501682 -0.220712902 -0.364583092
[201] -0.321264472 0.437447161 -0.109669962 -0.322870492 0.044860535
[206] -0.014754869 -0.367828806 0.097128215 0.038374041 -0.146843096
[211] 0.041375353 0.008210783 0.299515756 -0.448068134 -0.442001095
[216] 0.349900116 0.674183564 -0.272782661 -0.213054687 -0.025015481
[221] -0.561505743 -0.286544073 -0.442277337 -0.123275666 -0.078772493
[226] -0.151711059 0.608866426 0.330810754 0.535025165 0.043403430
>
> proc.time()
user system elapsed
2.652 14.685 17.723
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x600001dc4000>
> .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: 0x600001dc4000>
> .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: 0x600001dc4000>
> .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: 0x600001dc4000>
> 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: 0x600001dcc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dcc000>
> .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: 0x600001dcc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dcc000>
> .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: 0x600001dcc000>
> 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: 0x600001dc8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dc8000>
> .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: 0x600001dc8000>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001dc8000>
> .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: 0x600001dc8000>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600001dc8000>
> .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: 0x600001dc8000>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600001dc8000>
> .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: 0x600001dc8000>
> 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: 0x600001dd4000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001dd4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dd4000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dd4000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1446811a1afd8" "BufferedMatrixFile14468e1f96f3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1446811a1afd8" "BufferedMatrixFile14468e1f96f3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dd4240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001dd4240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001dd4240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001dd4240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001dd4240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001dd4240>
> .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: 0x600001d9c0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001d9c0c0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001d9c0c0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001d9c0c0>
> 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: 0x600001d9c180>
> .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: 0x600001d9c180>
> rm(P)
>
> proc.time()
user system elapsed
0.325 0.156 0.513
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.334 0.098 0.465