| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-24 12:04 -0500 (Mon, 24 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4873 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4654 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4600 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.74.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2025-11-21 02:13:03 -0500 (Fri, 21 Nov 2025) |
| EndedAt: 2025-11-21 02:14:15 -0500 (Fri, 21 Nov 2025) |
| EllapsedTime: 72.0 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 Patched (2025-11-05 r88990)
* 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 Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
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.5-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 version 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble"
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.592 0.208 0.785
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble"
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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480715 25.7 1056237 56.5 NA 634468 33.9
Vcells 890621 6.8 8388608 64.0 65536 2108742 16.1
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 02:13:37 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] "Fri Nov 21 02:13:37 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: 0x6000017c0000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 02:13:44 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] "Fri Nov 21 02:13:46 2025"
>
> ColMode(tmp2)
<pointer: 0x6000017c0000>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.45069688 0.6864419 1.0773271 1.5877847
[2,] -0.09307669 2.3379001 0.3829902 -0.5334965
[3,] 0.84348337 0.3664210 -0.2301718 -0.3318678
[4,] -1.41094888 -0.3309005 -0.3727051 0.2173965
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.45069688 0.6864419 1.0773271 1.5877847
[2,] 0.09307669 2.3379001 0.3829902 0.5334965
[3,] 0.84348337 0.3664210 0.2301718 0.3318678
[4,] 1.41094888 0.3309005 0.3727051 0.2173965
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0225095 0.8285179 1.0379437 1.2600733
[2,] 0.3050847 1.5290193 0.6188620 0.7304085
[3,] 0.9184135 0.6053272 0.4797622 0.5760797
[4,] 1.1878337 0.5752395 0.6104958 0.4662580
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.67579 33.97162 36.45676 39.18852
[2,] 28.14392 42.62809 31.57161 32.83758
[3,] 35.02762 31.41969 30.02779 31.09266
[4,] 38.28929 31.08330 31.47766 29.87998
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000017c4000>
> exp(tmp5)
<pointer: 0x6000017c4000>
> log(tmp5,2)
<pointer: 0x6000017c4000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.7146
> Min(tmp5)
[1] 53.10598
> mean(tmp5)
[1] 72.63367
> Sum(tmp5)
[1] 14526.73
> Var(tmp5)
[1] 856.1802
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.60448 72.66013 71.05132 68.05572 75.00993 70.19503 67.96583 70.29306
[9] 71.46525 69.03591
> rowSums(tmp5)
[1] 1812.090 1453.203 1421.026 1361.114 1500.199 1403.901 1359.317 1405.861
[9] 1429.305 1380.718
> rowVars(tmp5)
[1] 7990.96418 59.52741 47.55941 60.60396 50.32317 43.15128
[7] 69.76920 90.82829 64.92879 69.09315
> rowSd(tmp5)
[1] 89.392193 7.715401 6.896333 7.784854 7.093883 6.568963 8.352796
[8] 9.530388 8.057840 8.312229
> rowMax(tmp5)
[1] 469.71459 88.72479 84.59105 83.12083 88.45859 81.81561 83.38561
[8] 86.14544 83.37222 84.88492
> rowMin(tmp5)
[1] 57.35923 58.57789 59.70167 55.66797 55.60348 56.97329 54.60987 53.43668
[9] 55.81408 53.10598
>
> colMeans(tmp5)
[1] 109.25768 73.04696 67.87996 72.08036 71.90408 70.16438 69.96997
[8] 71.81908 67.23178 69.69522 74.44107 69.34855 66.59587 71.53567
[15] 72.23294 70.55952 73.59816 66.85540 74.57462 69.88206
> colSums(tmp5)
[1] 1092.5768 730.4696 678.7996 720.8036 719.0408 701.6438 699.6997
[8] 718.1908 672.3178 696.9522 744.4107 693.4855 665.9587 715.3567
[15] 722.3294 705.5952 735.9816 668.5540 745.7462 698.8206
> colVars(tmp5)
[1] 16104.32039 117.73041 74.47781 84.33413 68.58932 76.55638
[7] 61.09410 50.77261 56.17515 101.14617 60.42591 29.72250
[13] 48.75364 58.73814 25.57324 38.02703 90.19219 36.91606
[19] 30.67386 29.72696
> colSd(tmp5)
[1] 126.902799 10.850364 8.630052 9.183361 8.281867 8.749650
[7] 7.816272 7.125490 7.495008 10.057145 7.773411 5.451834
[13] 6.982380 7.664081 5.056999 6.166606 9.496957 6.075859
[19] 5.538399 5.452244
> colMax(tmp5)
[1] 469.71459 88.72479 79.47212 84.60022 82.17376 81.66350 78.64611
[8] 81.63106 83.37222 88.45859 86.86142 77.24355 74.41445 84.59105
[15] 80.15524 77.36685 84.88492 77.47680 83.38561 75.73676
> colMin(tmp5)
[1] 57.20840 58.77510 53.10598 61.05868 55.66797 55.60348 53.43668 62.12231
[9] 56.97329 53.94133 64.48973 60.86235 54.60987 56.28942 63.96225 55.81408
[17] 57.35923 56.79466 66.07726 59.70167
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.60448 NA 71.05132 68.05572 75.00993 70.19503 67.96583 70.29306
[9] 71.46525 69.03591
> rowSums(tmp5)
[1] 1812.090 NA 1421.026 1361.114 1500.199 1403.901 1359.317 1405.861
[9] 1429.305 1380.718
> rowVars(tmp5)
[1] 7990.96418 59.44456 47.55941 60.60396 50.32317 43.15128
[7] 69.76920 90.82829 64.92879 69.09315
> rowSd(tmp5)
[1] 89.392193 7.710030 6.896333 7.784854 7.093883 6.568963 8.352796
[8] 9.530388 8.057840 8.312229
> rowMax(tmp5)
[1] 469.71459 NA 84.59105 83.12083 88.45859 81.81561 83.38561
[8] 86.14544 83.37222 84.88492
> rowMin(tmp5)
[1] 57.35923 NA 59.70167 55.66797 55.60348 56.97329 54.60987 53.43668
[9] 55.81408 53.10598
>
> colMeans(tmp5)
[1] 109.25768 73.04696 67.87996 72.08036 71.90408 70.16438 69.96997
[8] NA 67.23178 69.69522 74.44107 69.34855 66.59587 71.53567
[15] 72.23294 70.55952 73.59816 66.85540 74.57462 69.88206
> colSums(tmp5)
[1] 1092.5768 730.4696 678.7996 720.8036 719.0408 701.6438 699.6997
[8] NA 672.3178 696.9522 744.4107 693.4855 665.9587 715.3567
[15] 722.3294 705.5952 735.9816 668.5540 745.7462 698.8206
> colVars(tmp5)
[1] 16104.32039 117.73041 74.47781 84.33413 68.58932 76.55638
[7] 61.09410 NA 56.17515 101.14617 60.42591 29.72250
[13] 48.75364 58.73814 25.57324 38.02703 90.19219 36.91606
[19] 30.67386 29.72696
> colSd(tmp5)
[1] 126.902799 10.850364 8.630052 9.183361 8.281867 8.749650
[7] 7.816272 NA 7.495008 10.057145 7.773411 5.451834
[13] 6.982380 7.664081 5.056999 6.166606 9.496957 6.075859
[19] 5.538399 5.452244
> colMax(tmp5)
[1] 469.71459 88.72479 79.47212 84.60022 82.17376 81.66350 78.64611
[8] NA 83.37222 88.45859 86.86142 77.24355 74.41445 84.59105
[15] 80.15524 77.36685 84.88492 77.47680 83.38561 75.73676
> colMin(tmp5)
[1] 57.20840 58.77510 53.10598 61.05868 55.66797 55.60348 53.43668 NA
[9] 56.97329 53.94133 64.48973 60.86235 54.60987 56.28942 63.96225 55.81408
[17] 57.35923 56.79466 66.07726 59.70167
>
> Max(tmp5,na.rm=TRUE)
[1] 469.7146
> Min(tmp5,na.rm=TRUE)
[1] 53.10598
> mean(tmp5,na.rm=TRUE)
[1] 72.67179
> Sum(tmp5,na.rm=TRUE)
[1] 14461.69
> Var(tmp5,na.rm=TRUE)
[1] 860.2122
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.60448 73.06084 71.05132 68.05572 75.00993 70.19503 67.96583 70.29306
[9] 71.46525 69.03591
> rowSums(tmp5,na.rm=TRUE)
[1] 1812.090 1388.156 1421.026 1361.114 1500.199 1403.901 1359.317 1405.861
[9] 1429.305 1380.718
> rowVars(tmp5,na.rm=TRUE)
[1] 7990.96418 59.44456 47.55941 60.60396 50.32317 43.15128
[7] 69.76920 90.82829 64.92879 69.09315
> rowSd(tmp5,na.rm=TRUE)
[1] 89.392193 7.710030 6.896333 7.784854 7.093883 6.568963 8.352796
[8] 9.530388 8.057840 8.312229
> rowMax(tmp5,na.rm=TRUE)
[1] 469.71459 88.72479 84.59105 83.12083 88.45859 81.81561 83.38561
[8] 86.14544 83.37222 84.88492
> rowMin(tmp5,na.rm=TRUE)
[1] 57.35923 58.57789 59.70167 55.66797 55.60348 56.97329 54.60987 53.43668
[9] 55.81408 53.10598
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.25768 73.04696 67.87996 72.08036 71.90408 70.16438 69.96997
[8] 72.57159 67.23178 69.69522 74.44107 69.34855 66.59587 71.53567
[15] 72.23294 70.55952 73.59816 66.85540 74.57462 69.88206
> colSums(tmp5,na.rm=TRUE)
[1] 1092.5768 730.4696 678.7996 720.8036 719.0408 701.6438 699.6997
[8] 653.1443 672.3178 696.9522 744.4107 693.4855 665.9587 715.3567
[15] 722.3294 705.5952 735.9816 668.5540 745.7462 698.8206
> colVars(tmp5,na.rm=TRUE)
[1] 16104.32039 117.73041 74.47781 84.33413 68.58932 76.55638
[7] 61.09410 50.74862 56.17515 101.14617 60.42591 29.72250
[13] 48.75364 58.73814 25.57324 38.02703 90.19219 36.91606
[19] 30.67386 29.72696
> colSd(tmp5,na.rm=TRUE)
[1] 126.902799 10.850364 8.630052 9.183361 8.281867 8.749650
[7] 7.816272 7.123806 7.495008 10.057145 7.773411 5.451834
[13] 6.982380 7.664081 5.056999 6.166606 9.496957 6.075859
[19] 5.538399 5.452244
> colMax(tmp5,na.rm=TRUE)
[1] 469.71459 88.72479 79.47212 84.60022 82.17376 81.66350 78.64611
[8] 81.63106 83.37222 88.45859 86.86142 77.24355 74.41445 84.59105
[15] 80.15524 77.36685 84.88492 77.47680 83.38561 75.73676
> colMin(tmp5,na.rm=TRUE)
[1] 57.20840 58.77510 53.10598 61.05868 55.66797 55.60348 53.43668 62.12231
[9] 56.97329 53.94133 64.48973 60.86235 54.60987 56.28942 63.96225 55.81408
[17] 57.35923 56.79466 66.07726 59.70167
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.60448 NaN 71.05132 68.05572 75.00993 70.19503 67.96583 70.29306
[9] 71.46525 69.03591
> rowSums(tmp5,na.rm=TRUE)
[1] 1812.090 0.000 1421.026 1361.114 1500.199 1403.901 1359.317 1405.861
[9] 1429.305 1380.718
> rowVars(tmp5,na.rm=TRUE)
[1] 7990.96418 NA 47.55941 60.60396 50.32317 43.15128
[7] 69.76920 90.82829 64.92879 69.09315
> rowSd(tmp5,na.rm=TRUE)
[1] 89.392193 NA 6.896333 7.784854 7.093883 6.568963 8.352796
[8] 9.530388 8.057840 8.312229
> rowMax(tmp5,na.rm=TRUE)
[1] 469.71459 NA 84.59105 83.12083 88.45859 81.81561 83.38561
[8] 86.14544 83.37222 84.88492
> rowMin(tmp5,na.rm=TRUE)
[1] 57.35923 NA 59.70167 55.66797 55.60348 56.97329 54.60987 53.43668
[9] 55.81408 53.10598
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.88876 71.30498 68.12083 72.49516 70.76301 69.46931 69.11957
[8] NaN 66.56666 70.11868 73.06103 69.35460 66.30509 71.67569
[15] 72.36176 70.05664 74.29735 66.90874 73.94353 69.23153
> colSums(tmp5,na.rm=TRUE)
[1] 1033.9989 641.7448 613.0875 652.4565 636.8671 625.2238 622.0761
[8] 0.0000 599.0999 631.0681 657.5493 624.1914 596.7458 645.0812
[15] 651.2559 630.5097 668.6762 602.1786 665.4918 623.0838
> colVars(tmp5,na.rm=TRUE)
[1] 17760.63257 98.30859 83.13485 92.94019 62.51490 80.69093
[7] 60.59493 NA 58.22023 111.77215 46.55345 33.43740
[13] 53.89663 65.85985 28.58319 39.93537 95.96636 41.49857
[19] 30.02754 28.68205
> colSd(tmp5,na.rm=TRUE)
[1] 133.269023 9.915069 9.117831 9.640549 7.906637 8.982813
[7] 7.784275 NA 7.630218 10.572235 6.823009 5.782508
[13] 7.341432 8.115408 5.346325 6.319444 9.796242 6.441938
[19] 5.479739 5.355563
> colMax(tmp5,na.rm=TRUE)
[1] 469.71459 86.14544 79.47212 84.60022 81.70347 81.66350 78.64611
[8] -Inf 83.37222 88.45859 83.12083 77.24355 74.41445 84.59105
[15] 80.15524 77.36685 84.88492 77.47680 83.38561 75.35472
> colMin(tmp5,na.rm=TRUE)
[1] 57.20840 58.77510 53.10598 61.05868 55.66797 55.60348 53.43668 Inf
[9] 56.97329 53.94133 64.48973 60.86235 54.60987 56.28942 63.96225 55.81408
[17] 57.35923 56.79466 66.07726 59.70167
>
>
>
>
> 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] 338.1213 182.4649 288.6943 224.2997 203.9891 175.5932 186.2215 299.4210
[9] 179.9992 161.9415
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 338.1213 182.4649 288.6943 224.2997 203.9891 175.5932 186.2215 299.4210
[9] 179.9992 161.9415
>
>
>
> 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] 2.842171e-14 5.684342e-14 -2.842171e-14 2.842171e-14 -8.526513e-14
[6] 5.684342e-14 0.000000e+00 -1.136868e-13 -5.684342e-14 2.842171e-14
[11] 1.421085e-13 5.684342e-14 0.000000e+00 -1.705303e-13 0.000000e+00
[16] 1.421085e-13 -2.557954e-13 1.421085e-14 0.000000e+00 1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 13
1 20
9 1
2 2
9 18
2 15
7 15
6 9
8 15
5 19
1 1
10 14
3 17
6 12
10 7
3 6
1 3
10 16
6 8
4 19
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.02309
> Min(tmp)
[1] -2.472752
> mean(tmp)
[1] -0.03666973
> Sum(tmp)
[1] -3.666973
> Var(tmp)
[1] 0.8948346
>
> rowMeans(tmp)
[1] -0.03666973
> rowSums(tmp)
[1] -3.666973
> rowVars(tmp)
[1] 0.8948346
> rowSd(tmp)
[1] 0.945957
> rowMax(tmp)
[1] 2.02309
> rowMin(tmp)
[1] -2.472752
>
> colMeans(tmp)
[1] 0.394324738 -1.360009711 -2.197101947 -1.475222350 -0.950864325
[6] 2.023090449 0.464331443 0.253254815 -1.179893033 -1.149530790
[11] 1.082352473 -1.444193597 0.710823117 -1.631303659 0.238645250
[16] 0.000656901 0.142026058 0.368003987 0.117807880 -0.016909028
[21] -0.105295869 -0.936504116 -0.356292343 0.249539477 -0.858579125
[26] -1.202318772 -0.732509273 0.338126212 0.474211713 -0.827045168
[31] -0.605299368 0.890467596 1.660698600 0.982331290 0.754755879
[36] -1.530547223 -0.388172753 -1.664110444 0.597582515 -1.937452485
[41] 1.002149043 0.089790883 -0.111827984 1.528797241 0.808642691
[46] -0.402508473 -1.374341340 1.280391693 -0.541921282 -1.462889170
[51] -0.398046219 0.637988564 -0.584247653 0.016391203 -0.137713588
[56] -0.032990965 1.130861446 0.429364692 0.557140901 -0.163587564
[61] 0.077403984 0.252616065 -1.201568398 0.720685333 1.263452924
[66] -0.595033412 -0.147657440 1.114150665 1.282765893 -0.381494140
[71] -0.453091359 -0.036820844 1.626796329 -0.058100814 -2.472751836
[76] -0.262626671 0.672962512 0.775493225 0.875041792 -0.545443300
[81] 0.621277846 0.585823695 1.089702487 0.917491459 -1.036951454
[86] -1.415564689 1.011080932 -0.019447296 -0.359931247 0.398523329
[91] 1.967023407 -0.352615863 0.641192485 0.586583527 -0.523722129
[96] 0.154210172 -1.137559081 0.368290452 -0.788346747 -0.346133761
> colSums(tmp)
[1] 0.394324738 -1.360009711 -2.197101947 -1.475222350 -0.950864325
[6] 2.023090449 0.464331443 0.253254815 -1.179893033 -1.149530790
[11] 1.082352473 -1.444193597 0.710823117 -1.631303659 0.238645250
[16] 0.000656901 0.142026058 0.368003987 0.117807880 -0.016909028
[21] -0.105295869 -0.936504116 -0.356292343 0.249539477 -0.858579125
[26] -1.202318772 -0.732509273 0.338126212 0.474211713 -0.827045168
[31] -0.605299368 0.890467596 1.660698600 0.982331290 0.754755879
[36] -1.530547223 -0.388172753 -1.664110444 0.597582515 -1.937452485
[41] 1.002149043 0.089790883 -0.111827984 1.528797241 0.808642691
[46] -0.402508473 -1.374341340 1.280391693 -0.541921282 -1.462889170
[51] -0.398046219 0.637988564 -0.584247653 0.016391203 -0.137713588
[56] -0.032990965 1.130861446 0.429364692 0.557140901 -0.163587564
[61] 0.077403984 0.252616065 -1.201568398 0.720685333 1.263452924
[66] -0.595033412 -0.147657440 1.114150665 1.282765893 -0.381494140
[71] -0.453091359 -0.036820844 1.626796329 -0.058100814 -2.472751836
[76] -0.262626671 0.672962512 0.775493225 0.875041792 -0.545443300
[81] 0.621277846 0.585823695 1.089702487 0.917491459 -1.036951454
[86] -1.415564689 1.011080932 -0.019447296 -0.359931247 0.398523329
[91] 1.967023407 -0.352615863 0.641192485 0.586583527 -0.523722129
[96] 0.154210172 -1.137559081 0.368290452 -0.788346747 -0.346133761
> 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.394324738 -1.360009711 -2.197101947 -1.475222350 -0.950864325
[6] 2.023090449 0.464331443 0.253254815 -1.179893033 -1.149530790
[11] 1.082352473 -1.444193597 0.710823117 -1.631303659 0.238645250
[16] 0.000656901 0.142026058 0.368003987 0.117807880 -0.016909028
[21] -0.105295869 -0.936504116 -0.356292343 0.249539477 -0.858579125
[26] -1.202318772 -0.732509273 0.338126212 0.474211713 -0.827045168
[31] -0.605299368 0.890467596 1.660698600 0.982331290 0.754755879
[36] -1.530547223 -0.388172753 -1.664110444 0.597582515 -1.937452485
[41] 1.002149043 0.089790883 -0.111827984 1.528797241 0.808642691
[46] -0.402508473 -1.374341340 1.280391693 -0.541921282 -1.462889170
[51] -0.398046219 0.637988564 -0.584247653 0.016391203 -0.137713588
[56] -0.032990965 1.130861446 0.429364692 0.557140901 -0.163587564
[61] 0.077403984 0.252616065 -1.201568398 0.720685333 1.263452924
[66] -0.595033412 -0.147657440 1.114150665 1.282765893 -0.381494140
[71] -0.453091359 -0.036820844 1.626796329 -0.058100814 -2.472751836
[76] -0.262626671 0.672962512 0.775493225 0.875041792 -0.545443300
[81] 0.621277846 0.585823695 1.089702487 0.917491459 -1.036951454
[86] -1.415564689 1.011080932 -0.019447296 -0.359931247 0.398523329
[91] 1.967023407 -0.352615863 0.641192485 0.586583527 -0.523722129
[96] 0.154210172 -1.137559081 0.368290452 -0.788346747 -0.346133761
> colMin(tmp)
[1] 0.394324738 -1.360009711 -2.197101947 -1.475222350 -0.950864325
[6] 2.023090449 0.464331443 0.253254815 -1.179893033 -1.149530790
[11] 1.082352473 -1.444193597 0.710823117 -1.631303659 0.238645250
[16] 0.000656901 0.142026058 0.368003987 0.117807880 -0.016909028
[21] -0.105295869 -0.936504116 -0.356292343 0.249539477 -0.858579125
[26] -1.202318772 -0.732509273 0.338126212 0.474211713 -0.827045168
[31] -0.605299368 0.890467596 1.660698600 0.982331290 0.754755879
[36] -1.530547223 -0.388172753 -1.664110444 0.597582515 -1.937452485
[41] 1.002149043 0.089790883 -0.111827984 1.528797241 0.808642691
[46] -0.402508473 -1.374341340 1.280391693 -0.541921282 -1.462889170
[51] -0.398046219 0.637988564 -0.584247653 0.016391203 -0.137713588
[56] -0.032990965 1.130861446 0.429364692 0.557140901 -0.163587564
[61] 0.077403984 0.252616065 -1.201568398 0.720685333 1.263452924
[66] -0.595033412 -0.147657440 1.114150665 1.282765893 -0.381494140
[71] -0.453091359 -0.036820844 1.626796329 -0.058100814 -2.472751836
[76] -0.262626671 0.672962512 0.775493225 0.875041792 -0.545443300
[81] 0.621277846 0.585823695 1.089702487 0.917491459 -1.036951454
[86] -1.415564689 1.011080932 -0.019447296 -0.359931247 0.398523329
[91] 1.967023407 -0.352615863 0.641192485 0.586583527 -0.523722129
[96] 0.154210172 -1.137559081 0.368290452 -0.788346747 -0.346133761
> colMedians(tmp)
[1] 0.394324738 -1.360009711 -2.197101947 -1.475222350 -0.950864325
[6] 2.023090449 0.464331443 0.253254815 -1.179893033 -1.149530790
[11] 1.082352473 -1.444193597 0.710823117 -1.631303659 0.238645250
[16] 0.000656901 0.142026058 0.368003987 0.117807880 -0.016909028
[21] -0.105295869 -0.936504116 -0.356292343 0.249539477 -0.858579125
[26] -1.202318772 -0.732509273 0.338126212 0.474211713 -0.827045168
[31] -0.605299368 0.890467596 1.660698600 0.982331290 0.754755879
[36] -1.530547223 -0.388172753 -1.664110444 0.597582515 -1.937452485
[41] 1.002149043 0.089790883 -0.111827984 1.528797241 0.808642691
[46] -0.402508473 -1.374341340 1.280391693 -0.541921282 -1.462889170
[51] -0.398046219 0.637988564 -0.584247653 0.016391203 -0.137713588
[56] -0.032990965 1.130861446 0.429364692 0.557140901 -0.163587564
[61] 0.077403984 0.252616065 -1.201568398 0.720685333 1.263452924
[66] -0.595033412 -0.147657440 1.114150665 1.282765893 -0.381494140
[71] -0.453091359 -0.036820844 1.626796329 -0.058100814 -2.472751836
[76] -0.262626671 0.672962512 0.775493225 0.875041792 -0.545443300
[81] 0.621277846 0.585823695 1.089702487 0.917491459 -1.036951454
[86] -1.415564689 1.011080932 -0.019447296 -0.359931247 0.398523329
[91] 1.967023407 -0.352615863 0.641192485 0.586583527 -0.523722129
[96] 0.154210172 -1.137559081 0.368290452 -0.788346747 -0.346133761
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.3943247 -1.36001 -2.197102 -1.475222 -0.9508643 2.02309 0.4643314
[2,] 0.3943247 -1.36001 -2.197102 -1.475222 -0.9508643 2.02309 0.4643314
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.2532548 -1.179893 -1.149531 1.082352 -1.444194 0.7108231 -1.631304
[2,] 0.2532548 -1.179893 -1.149531 1.082352 -1.444194 0.7108231 -1.631304
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.2386453 0.000656901 0.1420261 0.368004 0.1178079 -0.01690903 -0.1052959
[2,] 0.2386453 0.000656901 0.1420261 0.368004 0.1178079 -0.01690903 -0.1052959
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.9365041 -0.3562923 0.2495395 -0.8585791 -1.202319 -0.7325093 0.3381262
[2,] -0.9365041 -0.3562923 0.2495395 -0.8585791 -1.202319 -0.7325093 0.3381262
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.4742117 -0.8270452 -0.6052994 0.8904676 1.660699 0.9823313 0.7547559
[2,] 0.4742117 -0.8270452 -0.6052994 0.8904676 1.660699 0.9823313 0.7547559
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.530547 -0.3881728 -1.66411 0.5975825 -1.937452 1.002149 0.08979088
[2,] -1.530547 -0.3881728 -1.66411 0.5975825 -1.937452 1.002149 0.08979088
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.111828 1.528797 0.8086427 -0.4025085 -1.374341 1.280392 -0.5419213
[2,] -0.111828 1.528797 0.8086427 -0.4025085 -1.374341 1.280392 -0.5419213
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.462889 -0.3980462 0.6379886 -0.5842477 0.0163912 -0.1377136 -0.03299097
[2,] -1.462889 -0.3980462 0.6379886 -0.5842477 0.0163912 -0.1377136 -0.03299097
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.130861 0.4293647 0.5571409 -0.1635876 0.07740398 0.2526161 -1.201568
[2,] 1.130861 0.4293647 0.5571409 -0.1635876 0.07740398 0.2526161 -1.201568
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7206853 1.263453 -0.5950334 -0.1476574 1.114151 1.282766 -0.3814941
[2,] 0.7206853 1.263453 -0.5950334 -0.1476574 1.114151 1.282766 -0.3814941
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.4530914 -0.03682084 1.626796 -0.05810081 -2.472752 -0.2626267 0.6729625
[2,] -0.4530914 -0.03682084 1.626796 -0.05810081 -2.472752 -0.2626267 0.6729625
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.7754932 0.8750418 -0.5454433 0.6212778 0.5858237 1.089702 0.9174915
[2,] 0.7754932 0.8750418 -0.5454433 0.6212778 0.5858237 1.089702 0.9174915
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.036951 -1.415565 1.011081 -0.0194473 -0.3599312 0.3985233 1.967023
[2,] -1.036951 -1.415565 1.011081 -0.0194473 -0.3599312 0.3985233 1.967023
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.3526159 0.6411925 0.5865835 -0.5237221 0.1542102 -1.137559 0.3682905
[2,] -0.3526159 0.6411925 0.5865835 -0.5237221 0.1542102 -1.137559 0.3682905
[,99] [,100]
[1,] -0.7883467 -0.3461338
[2,] -0.7883467 -0.3461338
>
>
> Max(tmp2)
[1] 2.840545
> Min(tmp2)
[1] -2.253848
> mean(tmp2)
[1] -0.0003751088
> Sum(tmp2)
[1] -0.03751088
> Var(tmp2)
[1] 0.8105282
>
> rowMeans(tmp2)
[1] -2.25384764 1.36866016 -0.44803892 -0.55974583 -0.41484807 0.51514144
[7] 0.38993639 1.06011907 0.61364931 -1.41670671 0.31448967 0.60557872
[13] 0.62639864 0.42940986 0.65174556 -1.55884951 -1.20589045 -1.92824413
[19] -0.76610014 -0.13549625 -0.62155938 -1.82223200 1.01748422 -0.60725717
[25] 0.30992175 -0.96761168 -1.48400256 -0.17072031 1.01980434 -1.47755168
[31] -0.85992857 0.03854832 -0.03466439 0.62501762 -1.00245832 -0.04632518
[37] 1.16936768 -0.66521662 0.45359307 -0.19373570 0.52345713 1.04939278
[43] 0.69956791 0.77274312 0.72442910 -0.21942465 1.12914309 -0.70911135
[49] 1.72700891 0.26389142 -0.97873128 -0.60205289 -0.33525917 -0.50120194
[55] 1.27130383 0.20652346 0.47127537 0.41542539 -0.44385510 0.78913531
[61] -1.33229292 -0.34246988 -0.95423692 1.33229096 0.52029599 -0.20569536
[67] -1.00702204 2.84054544 0.35014029 0.32923467 0.68710326 -1.16990158
[73] -0.21678093 0.98328968 0.82870627 0.53905984 0.46271073 0.21212259
[79] 0.22267666 -1.54194880 -0.44082211 0.67484118 0.15850029 0.18648136
[85] 0.60648891 -1.00829702 0.02245115 0.88760086 0.26529584 0.72971993
[91] -0.05357994 1.22262869 -0.11826408 -1.59350970 0.68378320 -1.00680858
[97] -0.02231253 0.51427854 -0.25743298 -0.84787686
> rowSums(tmp2)
[1] -2.25384764 1.36866016 -0.44803892 -0.55974583 -0.41484807 0.51514144
[7] 0.38993639 1.06011907 0.61364931 -1.41670671 0.31448967 0.60557872
[13] 0.62639864 0.42940986 0.65174556 -1.55884951 -1.20589045 -1.92824413
[19] -0.76610014 -0.13549625 -0.62155938 -1.82223200 1.01748422 -0.60725717
[25] 0.30992175 -0.96761168 -1.48400256 -0.17072031 1.01980434 -1.47755168
[31] -0.85992857 0.03854832 -0.03466439 0.62501762 -1.00245832 -0.04632518
[37] 1.16936768 -0.66521662 0.45359307 -0.19373570 0.52345713 1.04939278
[43] 0.69956791 0.77274312 0.72442910 -0.21942465 1.12914309 -0.70911135
[49] 1.72700891 0.26389142 -0.97873128 -0.60205289 -0.33525917 -0.50120194
[55] 1.27130383 0.20652346 0.47127537 0.41542539 -0.44385510 0.78913531
[61] -1.33229292 -0.34246988 -0.95423692 1.33229096 0.52029599 -0.20569536
[67] -1.00702204 2.84054544 0.35014029 0.32923467 0.68710326 -1.16990158
[73] -0.21678093 0.98328968 0.82870627 0.53905984 0.46271073 0.21212259
[79] 0.22267666 -1.54194880 -0.44082211 0.67484118 0.15850029 0.18648136
[85] 0.60648891 -1.00829702 0.02245115 0.88760086 0.26529584 0.72971993
[91] -0.05357994 1.22262869 -0.11826408 -1.59350970 0.68378320 -1.00680858
[97] -0.02231253 0.51427854 -0.25743298 -0.84787686
> 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] -2.25384764 1.36866016 -0.44803892 -0.55974583 -0.41484807 0.51514144
[7] 0.38993639 1.06011907 0.61364931 -1.41670671 0.31448967 0.60557872
[13] 0.62639864 0.42940986 0.65174556 -1.55884951 -1.20589045 -1.92824413
[19] -0.76610014 -0.13549625 -0.62155938 -1.82223200 1.01748422 -0.60725717
[25] 0.30992175 -0.96761168 -1.48400256 -0.17072031 1.01980434 -1.47755168
[31] -0.85992857 0.03854832 -0.03466439 0.62501762 -1.00245832 -0.04632518
[37] 1.16936768 -0.66521662 0.45359307 -0.19373570 0.52345713 1.04939278
[43] 0.69956791 0.77274312 0.72442910 -0.21942465 1.12914309 -0.70911135
[49] 1.72700891 0.26389142 -0.97873128 -0.60205289 -0.33525917 -0.50120194
[55] 1.27130383 0.20652346 0.47127537 0.41542539 -0.44385510 0.78913531
[61] -1.33229292 -0.34246988 -0.95423692 1.33229096 0.52029599 -0.20569536
[67] -1.00702204 2.84054544 0.35014029 0.32923467 0.68710326 -1.16990158
[73] -0.21678093 0.98328968 0.82870627 0.53905984 0.46271073 0.21212259
[79] 0.22267666 -1.54194880 -0.44082211 0.67484118 0.15850029 0.18648136
[85] 0.60648891 -1.00829702 0.02245115 0.88760086 0.26529584 0.72971993
[91] -0.05357994 1.22262869 -0.11826408 -1.59350970 0.68378320 -1.00680858
[97] -0.02231253 0.51427854 -0.25743298 -0.84787686
> rowMin(tmp2)
[1] -2.25384764 1.36866016 -0.44803892 -0.55974583 -0.41484807 0.51514144
[7] 0.38993639 1.06011907 0.61364931 -1.41670671 0.31448967 0.60557872
[13] 0.62639864 0.42940986 0.65174556 -1.55884951 -1.20589045 -1.92824413
[19] -0.76610014 -0.13549625 -0.62155938 -1.82223200 1.01748422 -0.60725717
[25] 0.30992175 -0.96761168 -1.48400256 -0.17072031 1.01980434 -1.47755168
[31] -0.85992857 0.03854832 -0.03466439 0.62501762 -1.00245832 -0.04632518
[37] 1.16936768 -0.66521662 0.45359307 -0.19373570 0.52345713 1.04939278
[43] 0.69956791 0.77274312 0.72442910 -0.21942465 1.12914309 -0.70911135
[49] 1.72700891 0.26389142 -0.97873128 -0.60205289 -0.33525917 -0.50120194
[55] 1.27130383 0.20652346 0.47127537 0.41542539 -0.44385510 0.78913531
[61] -1.33229292 -0.34246988 -0.95423692 1.33229096 0.52029599 -0.20569536
[67] -1.00702204 2.84054544 0.35014029 0.32923467 0.68710326 -1.16990158
[73] -0.21678093 0.98328968 0.82870627 0.53905984 0.46271073 0.21212259
[79] 0.22267666 -1.54194880 -0.44082211 0.67484118 0.15850029 0.18648136
[85] 0.60648891 -1.00829702 0.02245115 0.88760086 0.26529584 0.72971993
[91] -0.05357994 1.22262869 -0.11826408 -1.59350970 0.68378320 -1.00680858
[97] -0.02231253 0.51427854 -0.25743298 -0.84787686
>
> colMeans(tmp2)
[1] -0.0003751088
> colSums(tmp2)
[1] -0.03751088
> colVars(tmp2)
[1] 0.8105282
> colSd(tmp2)
[1] 0.9002934
> colMax(tmp2)
[1] 2.840545
> colMin(tmp2)
[1] -2.253848
> colMedians(tmp2)
[1] 0.1724908
> colRanges(tmp2)
[,1]
[1,] -2.253848
[2,] 2.840545
>
> 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] -4.14217945 0.21656864 3.60743020 0.19739151 -0.05722069 -0.33329432
[7] -0.24690261 1.52181728 -1.03443406 1.73504883
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.9554731
[2,] -0.9158852
[3,] -0.1591875
[4,] 0.2521071
[5,] 0.9137883
>
> rowApply(tmp,sum)
[1] -3.9273152 3.3839914 -1.4510442 -0.2586918 4.6976112 -3.0134835
[7] 2.0980372 1.9352207 2.3765662 -4.3766667
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 6 1 9 3 4 5 2 6 8
[2,] 2 9 2 5 6 5 9 7 5 3
[3,] 10 1 10 6 8 3 3 6 8 7
[4,] 1 10 4 7 4 8 10 1 2 10
[5,] 7 3 3 4 7 9 8 5 3 9
[6,] 5 5 5 1 2 2 6 8 10 6
[7,] 6 8 9 3 5 6 1 3 7 2
[8,] 9 7 6 10 1 10 2 9 1 4
[9,] 8 2 7 8 9 1 7 10 4 1
[10,] 4 4 8 2 10 7 4 4 9 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.3526068 -0.2451723 1.9658628 1.6746024 0.3105290 -3.9144275
[7] -0.5468418 -2.9670068 -1.5023014 3.0852258 -2.0355880 0.2155024
[13] -3.3761445 -2.1796880 -1.5890123 -2.4515033 -1.5799771 -0.8334966
[19] -4.8231184 -0.6693046
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.09839289
[2,] 0.01199603
[3,] 0.38829558
[4,] 0.88169850
[5,] 1.16900955
>
> rowApply(tmp,sum)
[1] -1.278557 -8.688190 -1.295085 -4.427063 -4.420358
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 16 19 18 5 13
[2,] 18 20 12 4 6
[3,] 14 13 11 18 20
[4,] 9 15 15 17 11
[5,] 2 18 19 10 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.38829558 0.5085156 0.27010393 -0.18219861 -0.8197585 -1.0347198
[2,] 1.16900955 1.2140500 -0.44468141 0.24954938 1.1003717 -1.2386218
[3,] 0.88169850 0.2991976 0.03472397 0.66062143 1.1507889 -1.7087305
[4,] -1.09839289 -1.5083574 1.16918417 0.96029299 -0.3510712 0.2010633
[5,] 0.01199603 -0.7585780 0.93653216 -0.01366283 -0.7698019 -0.1334186
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.5295480 -0.4711806 1.1006754 -0.046742906 -0.007244538 0.4538471
[2,] -1.2582000 -0.4761018 -1.7561227 0.998143499 -1.135165473 -0.6315067
[3,] -0.2025594 -2.1202424 -0.6859685 1.409271038 -0.639724112 -0.1518914
[4,] -0.4764988 -0.6146751 0.4222948 0.727088730 1.452558526 0.1675861
[5,] 0.8608683 0.7151931 -0.5831804 -0.002534601 -1.706012413 0.3774673
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4519865 -0.7173131 0.08533157 -0.1714165 -0.1966102 -0.5200792
[2,] -0.4130812 -0.8666121 -0.49101177 0.8042892 -1.1637625 -0.9347303
[3,] -0.7284672 -0.7416847 -0.60260601 0.5840251 0.7616899 0.8264325
[4,] -0.8674369 1.4858161 -0.66015752 -2.5292136 -1.6381010 0.1945257
[5,] -0.9151727 -1.3398942 0.07943143 -1.1391876 0.6568067 -0.3996453
[,19] [,20]
[1,] -0.3411120 0.3454884
[2,] -1.6507937 -1.7632125
[3,] -0.7904706 0.4688105
[4,] -2.1639941 0.7004253
[5,] 0.1232520 -0.4208163
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.818419 -0.7667314 0.1497987 -2.188209 0.2067652 -0.8580184 -0.8551525
col8 col9 col10 col11 col12 col13 col14
row1 -0.7356363 -1.7698 0.1591344 -1.594399 -0.04599039 0.5091654 -0.9129207
col15 col16 col17 col18 col19 col20
row1 -1.704916 -0.1324102 -0.7968548 1.138079 -1.906471 0.9686562
> tmp[,"col10"]
col10
row1 0.1591344
row2 -0.2515075
row3 -0.3998106
row4 0.2139546
row5 0.9653670
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.818419 -0.7667314 0.1497987 -2.1882086 0.2067652 -0.85801836 -0.8551525
row5 1.683905 -0.3666852 1.0965417 0.5243209 0.8964380 0.09601878 0.3940016
col8 col9 col10 col11 col12 col13
row1 -0.7356363 -1.7697999 0.1591344 -1.594399 -0.04599039 0.50916540
row5 -1.1148388 0.8932801 0.9653670 -1.744802 -0.76835249 -0.03804814
col14 col15 col16 col17 col18 col19 col20
row1 -0.9129207 -1.7049161 -0.1324102 -0.7968548 1.1380787 -1.906471 0.9686562
row5 3.1768195 -0.4799636 0.2040845 2.4703535 -0.4511983 1.915226 1.8046087
> tmp[,c("col6","col20")]
col6 col20
row1 -0.85801836 0.9686562
row2 -0.39565125 0.0297784
row3 -1.52095739 0.1469399
row4 -1.84483738 0.5607451
row5 0.09601878 1.8046087
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.85801836 0.9686562
row5 0.09601878 1.8046087
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.07977 50.4459 50.8063 51.39824 50.133 104.0758 49.89516 47.49751
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.63958 49.5059 49.89386 50.70438 50.29633 48.83709 50.10616 51.25382
col17 col18 col19 col20
row1 51.68235 51.29519 50.34647 106.1255
> tmp[,"col10"]
col10
row1 49.50590
row2 32.05301
row3 32.32837
row4 29.73315
row5 51.57879
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.07977 50.44590 50.80630 51.39824 50.1330 104.0758 49.89516 47.49751
row5 52.06316 48.20712 49.74771 47.90806 49.5405 103.5999 51.09984 49.31653
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.63958 49.50590 49.89386 50.70438 50.29633 48.83709 50.10616 51.25382
row5 49.49174 51.57879 50.86312 49.46078 50.20061 48.98331 49.73179 51.35266
col17 col18 col19 col20
row1 51.68235 51.29519 50.34647 106.1255
row5 49.83668 50.34487 50.65435 105.0664
> tmp[,c("col6","col20")]
col6 col20
row1 104.07577 106.12549
row2 74.74780 75.25562
row3 73.55210 75.06709
row4 76.21443 75.07526
row5 103.59989 105.06642
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.0758 106.1255
row5 103.5999 105.0664
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.0758 106.1255
row5 103.5999 105.0664
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.04625232
[2,] -0.45893076
[3,] 0.09024232
[4,] 0.54430593
[5,] -0.42610147
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.8855029 1.1003662
[2,] 0.9663187 -0.8250151
[3,] 1.1472232 0.8792278
[4,] -0.3769828 -0.3294262
[5,] -0.5343903 -0.8299555
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.3046834 0.7767727
[2,] 2.0540321 0.4203849
[3,] 0.1934709 -0.4156417
[4,] 1.1378167 0.9612604
[5,] 1.5767552 1.1672925
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.304683
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.304683
[2,] 2.054032
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.5671102 -0.3839055 -0.2922628 -1.0222179 0.9455424 0.3034228 -0.9855657
row1 0.5293856 -0.9410462 2.0806643 0.2283072 -1.3893107 0.3805508 0.3507032
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.392094 0.6021550 0.7134642 0.7124434 0.2387960 -1.014644 -0.2069046
row1 -2.669738 0.3807313 0.1831368 0.5442910 0.5611082 -1.010219 0.5896876
[,15] [,16] [,17] [,18] [,19] [,20]
row3 0.6986061 0.3071033 0.2536180 0.7899883 0.2409754 -0.03234123
row1 0.5242100 -1.8806014 0.3519485 -0.5021464 -1.0344850 0.01283394
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.41844 -0.6068978 -0.888637 0.1277754 -0.6190859 -0.04759227 1.315547
[,8] [,9] [,10]
row2 -0.7448642 -0.2795625 -0.8581579
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.2877352 0.09022147 0.6011054 1.895051 0.374905 0.1645045 0.1219857
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.9206616 -0.3720105 0.8972621 -0.6023843 0.8210332 0.8597717 -1.988887
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.4003001 -0.1801873 0.04709202 1.133312 0.2548901 0.3419079
>
>
> 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: 0x6000017b8120>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd7faba9a"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd5df0d88d"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd6f194129"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd630523ba"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd666cbb1f"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd6c7124c1"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd78243285"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd1070f762"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd68814b5c"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd7aba9e"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd7971db50"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd21f59f7a"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd4b91401"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd12d05013"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb2cd2a39190b"
>
>
> ### 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: 0x6000017c80c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000017c80c0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000017c80c0>
> rowMedians(tmp)
[1] -0.588098715 0.061127110 0.341266628 -0.349470553 -0.506135678
[6] -0.016755117 -0.313378892 0.297029177 -0.258704202 -0.100268635
[11] 0.239995030 0.297777175 -0.314211883 -0.115685078 0.067261210
[16] 0.328244798 0.228447000 0.101880425 -0.042228970 -0.245897739
[21] 0.202561839 -0.345704672 -0.614533808 -0.576630090 0.074608800
[26] -0.045606956 -0.376516607 0.395235943 -0.461426649 0.017795492
[31] 0.020984117 0.326026677 -0.730527238 0.323851787 -0.575551015
[36] -0.362740065 -0.009942520 0.108461108 -0.182935961 -0.056656498
[41] -0.307370272 0.133802917 -0.487223282 -0.507162943 -0.061945062
[46] 0.336349334 0.311966245 -0.270476550 -0.036576800 -0.071177185
[51] -0.095063685 -0.177637319 -0.054461676 0.300126692 0.166049404
[56] 0.287338876 0.128002372 0.040007293 -0.111432209 -0.158566417
[61] 0.795851587 -0.356208560 -0.256197835 0.062848112 -0.126164139
[66] -0.272776015 -0.070066993 0.406276886 -0.120909206 0.837532012
[71] 0.008135830 -0.162279973 -0.005881140 0.229042990 0.008516049
[76] 0.071652537 0.052248882 0.132883480 -0.636580920 -0.214143085
[81] -0.301919763 -0.097667032 -0.309609956 -0.157864988 0.248731424
[86] 0.411299359 0.188740946 -0.675423515 0.457703226 0.210265558
[91] -0.504982556 -0.315451981 -0.012376925 -0.695719816 0.144809054
[96] 0.041956393 0.001566480 -0.277749803 0.190937495 -0.136411260
[101] -0.152318235 0.103628409 0.102462795 -0.056115279 -0.424837199
[106] -0.436194103 -0.397227931 0.301966187 0.039566946 -0.148961998
[111] 0.046055632 -0.293621987 0.360304117 -0.241665585 -0.240437824
[116] -0.001396061 0.362220718 -0.378923796 0.072556736 -0.236245419
[121] -0.373067350 0.025515858 0.049911141 0.295133386 -0.532454193
[126] -0.538468498 -0.160473777 0.826709185 -0.603702734 0.129519391
[131] 0.035632800 0.102981610 0.014693836 -0.383540591 0.040463813
[136] 0.260630836 0.036921554 -0.045117016 -0.005697474 -0.018556614
[141] -0.186373889 -0.136908208 0.079192596 0.162935345 0.082435982
[146] 0.065925055 -0.146505325 -0.125346320 0.120656937 0.072368836
[151] -0.147737776 -0.761778932 -0.054514096 0.531906371 0.536059538
[156] -0.246324374 -0.339339878 -0.823190788 -0.231077388 0.167619669
[161] 0.065720119 -0.305950244 -0.670335926 -0.684832788 -0.201287270
[166] -0.367382984 0.066816451 0.078671217 -0.335166114 0.305527980
[171] -0.095840545 -0.270082293 0.208664557 0.616336808 -0.394162888
[176] 0.434924672 -0.420157212 0.279009336 -0.227657275 -0.231235593
[181] 0.322008727 0.333369501 -0.073271133 -0.028800999 -0.011875567
[186] 0.455089598 -0.022499513 0.272843353 0.279083200 -0.060002008
[191] 0.424079973 0.393818212 0.032471440 0.014128452 -0.476143554
[196] 0.048874054 -0.120805110 0.093433745 0.067437225 0.510459335
[201] -0.083195453 0.001617490 0.284430448 -0.195110568 0.088269159
[206] -0.197482941 0.025932585 0.034589971 0.153771295 0.537253736
[211] -0.146655957 -0.214161824 0.119430471 -0.457697763 -0.014530468
[216] -0.166559377 0.253373656 -0.241481965 0.328501922 -0.172986501
[221] 0.083053820 -0.015225696 0.280851996 0.508703710 -0.294039395
[226] 0.346812713 -0.019995640 0.593546350 -0.497605088 0.318332841
>
> proc.time()
user system elapsed
5.079 18.626 26.677
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble"
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: 0x600003ed8060>
> .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: 0x600003ed8060>
> .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: 0x600003ed8060>
> .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: 0x600003ed8060>
> 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: 0x600003e9c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c000>
> .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: 0x600003e9c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c000>
> .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: 0x600003e9c000>
> 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: 0x600003ef81e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ef81e0>
> .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: 0x600003ef81e0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003ef81e0>
> .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: 0x600003ef81e0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600003ef81e0>
> .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: 0x600003ef81e0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600003ef81e0>
> .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: 0x600003ef81e0>
> 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: 0x600003ed8420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003ed8420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ed8420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ed8420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileb4dd2dbb4bf3" "BufferedMatrixFileb4dd33beb66f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileb4dd2dbb4bf3" "BufferedMatrixFileb4dd33beb66f"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ed86c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ed86c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003ed86c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003ed86c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003ed86c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003ed86c0>
> .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: 0x600003ed88a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003ed88a0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003ed88a0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003ed88a0>
> 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: 0x600003ed0060>
> .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: 0x600003ed0060>
> rm(P)
>
> proc.time()
user system elapsed
0.591 0.210 0.808
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble"
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.597 0.139 0.725