| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-20 12:04 -0500 (Thu, 20 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" | 4615 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4610 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4598 |
| 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-18 04:41:01 -0500 (Tue, 18 Nov 2025) |
| EndedAt: 2025-11-18 04:42:10 -0500 (Tue, 18 Nov 2025) |
| EllapsedTime: 69.4 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.591 0.203 0.764
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 1056255 56.5 NA 634432 33.9
Vcells 890629 6.8 8388608 64.0 65536 2109070 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] "Tue Nov 18 04:41:34 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] "Tue Nov 18 04:41:35 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: 0x600000d4c480>
>
>
>
> 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] "Tue Nov 18 04:41:40 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] "Tue Nov 18 04:41:43 2025"
>
> ColMode(tmp2)
<pointer: 0x600000d4c480>
>
>
>
> ### 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.386591 0.6112188 -1.1329953 -1.2966042
[2,] 1.847131 0.1565492 -1.7133564 0.3328106
[3,] -1.358322 1.8413884 0.3166464 -2.2908446
[4,] 1.615094 1.8025087 0.2991875 0.3907257
> 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,] 101.386591 0.6112188 1.1329953 1.2966042
[2,] 1.847131 0.1565492 1.7133564 0.3328106
[3,] 1.358322 1.8413884 0.3166464 2.2908446
[4,] 1.615094 1.8025087 0.2991875 0.3907257
> 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.069091 0.7818049 1.0644225 1.1386853
[2,] 1.359092 0.3956630 1.3089524 0.5768974
[3,] 1.165471 1.3569777 0.5627135 1.5135536
[4,] 1.270863 1.3425754 0.5469804 0.6250806
>
> 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,] 227.07750 33.42927 36.77722 37.68346
[2,] 40.43805 29.11318 39.80288 31.10178
[3,] 38.01303 40.41117 30.94378 42.42638
[4,] 39.32373 40.22826 30.76899 31.64153
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000d68000>
> exp(tmp5)
<pointer: 0x600000d68000>
> log(tmp5,2)
<pointer: 0x600000d68000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.6321
> Min(tmp5)
[1] 53.18075
> mean(tmp5)
[1] 72.87004
> Sum(tmp5)
[1] 14574.01
> Var(tmp5)
[1] 887.8264
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.50457 69.95970 73.60406 72.06326 70.65621 70.32242 70.43457 70.08986
[9] 67.19855 72.86723
> rowSums(tmp5)
[1] 1830.091 1399.194 1472.081 1441.265 1413.124 1406.448 1408.691 1401.797
[9] 1343.971 1457.345
> rowVars(tmp5)
[1] 8127.30821 58.28148 92.89418 54.89297 93.50537 92.57313
[7] 89.52685 86.60220 84.31279 82.99643
> rowSd(tmp5)
[1] 90.151585 7.634231 9.638163 7.408979 9.669817 9.621493 9.461863
[8] 9.306030 9.182200 9.110237
> rowMax(tmp5)
[1] 472.63206 84.16651 88.50209 83.72986 90.64354 87.48001 84.84995
[8] 92.76790 84.06139 90.76519
> rowMin(tmp5)
[1] 56.26448 59.73209 55.20309 62.20729 55.87725 55.56250 56.76317 55.71042
[9] 53.18075 55.04853
>
> colMeans(tmp5)
[1] 112.54589 70.61960 71.73569 70.02758 72.66207 67.76595 72.15287
[8] 71.22215 66.07394 64.53260 70.35943 70.68174 73.66706 66.20897
[15] 73.72770 74.18508 71.19471 71.56365 72.46903 74.00515
> colSums(tmp5)
[1] 1125.4589 706.1960 717.3569 700.2758 726.6207 677.6595 721.5287
[8] 712.2215 660.7394 645.3260 703.5943 706.8174 736.6706 662.0897
[15] 737.2770 741.8508 711.9471 715.6365 724.6903 740.0515
> colVars(tmp5)
[1] 16089.20596 132.50321 91.41225 70.76606 81.61531 37.51561
[7] 43.48625 29.42716 81.70021 73.06964 101.95806 78.66644
[13] 70.50171 101.73338 28.69027 206.80123 67.52616 86.39831
[19] 47.00267 112.89978
> colSd(tmp5)
[1] 126.843234 11.511004 9.560975 8.412257 9.034119 6.124999
[7] 6.594411 5.424681 9.038817 8.548078 10.097428 8.869410
[13] 8.396529 10.086296 5.356330 14.380585 8.217430 9.295069
[19] 6.855849 10.625431
> colMax(tmp5)
[1] 472.63206 84.11055 85.06390 88.30495 84.00617 77.49058 84.37191
[8] 80.79645 85.44691 78.46869 90.64354 84.06139 85.27557 81.37623
[15] 81.44150 95.91998 87.48001 84.08072 80.62887 88.50209
> colMin(tmp5)
[1] 60.09695 53.18075 54.10659 57.94661 55.87725 59.39594 64.93866 60.99950
[9] 57.12632 55.71042 57.04607 55.56250 59.77902 55.20309 66.87598 59.55972
[17] 56.76317 55.04853 61.28739 57.49018
>
>
> ### 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] NA 69.95970 73.60406 72.06326 70.65621 70.32242 70.43457 70.08986
[9] 67.19855 72.86723
> rowSums(tmp5)
[1] NA 1399.194 1472.081 1441.265 1413.124 1406.448 1408.691 1401.797
[9] 1343.971 1457.345
> rowVars(tmp5)
[1] 8577.68522 58.28148 92.89418 54.89297 93.50537 92.57313
[7] 89.52685 86.60220 84.31279 82.99643
> rowSd(tmp5)
[1] 92.615794 7.634231 9.638163 7.408979 9.669817 9.621493 9.461863
[8] 9.306030 9.182200 9.110237
> rowMax(tmp5)
[1] NA 84.16651 88.50209 83.72986 90.64354 87.48001 84.84995 92.76790
[9] 84.06139 90.76519
> rowMin(tmp5)
[1] NA 59.73209 55.20309 62.20729 55.87725 55.56250 56.76317 55.71042
[9] 53.18075 55.04853
>
> colMeans(tmp5)
[1] 112.54589 70.61960 71.73569 70.02758 72.66207 67.76595 72.15287
[8] 71.22215 66.07394 64.53260 70.35943 70.68174 73.66706 66.20897
[15] 73.72770 NA 71.19471 71.56365 72.46903 74.00515
> colSums(tmp5)
[1] 1125.4589 706.1960 717.3569 700.2758 726.6207 677.6595 721.5287
[8] 712.2215 660.7394 645.3260 703.5943 706.8174 736.6706 662.0897
[15] 737.2770 NA 711.9471 715.6365 724.6903 740.0515
> colVars(tmp5)
[1] 16089.20596 132.50321 91.41225 70.76606 81.61531 37.51561
[7] 43.48625 29.42716 81.70021 73.06964 101.95806 78.66644
[13] 70.50171 101.73338 28.69027 NA 67.52616 86.39831
[19] 47.00267 112.89978
> colSd(tmp5)
[1] 126.843234 11.511004 9.560975 8.412257 9.034119 6.124999
[7] 6.594411 5.424681 9.038817 8.548078 10.097428 8.869410
[13] 8.396529 10.086296 5.356330 NA 8.217430 9.295069
[19] 6.855849 10.625431
> colMax(tmp5)
[1] 472.63206 84.11055 85.06390 88.30495 84.00617 77.49058 84.37191
[8] 80.79645 85.44691 78.46869 90.64354 84.06139 85.27557 81.37623
[15] 81.44150 NA 87.48001 84.08072 80.62887 88.50209
> colMin(tmp5)
[1] 60.09695 53.18075 54.10659 57.94661 55.87725 59.39594 64.93866 60.99950
[9] 57.12632 55.71042 57.04607 55.56250 59.77902 55.20309 66.87598 NA
[17] 56.76317 55.04853 61.28739 57.49018
>
> Max(tmp5,na.rm=TRUE)
[1] 472.6321
> Min(tmp5,na.rm=TRUE)
[1] 53.18075
> mean(tmp5,na.rm=TRUE)
[1] 72.75421
> Sum(tmp5,na.rm=TRUE)
[1] 14478.09
> Var(tmp5,na.rm=TRUE)
[1] 889.6135
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.27218 69.95970 73.60406 72.06326 70.65621 70.32242 70.43457 70.08986
[9] 67.19855 72.86723
> rowSums(tmp5,na.rm=TRUE)
[1] 1734.171 1399.194 1472.081 1441.265 1413.124 1406.448 1408.691 1401.797
[9] 1343.971 1457.345
> rowVars(tmp5,na.rm=TRUE)
[1] 8577.68522 58.28148 92.89418 54.89297 93.50537 92.57313
[7] 89.52685 86.60220 84.31279 82.99643
> rowSd(tmp5,na.rm=TRUE)
[1] 92.615794 7.634231 9.638163 7.408979 9.669817 9.621493 9.461863
[8] 9.306030 9.182200 9.110237
> rowMax(tmp5,na.rm=TRUE)
[1] 472.63206 84.16651 88.50209 83.72986 90.64354 87.48001 84.84995
[8] 92.76790 84.06139 90.76519
> rowMin(tmp5,na.rm=TRUE)
[1] 56.26448 59.73209 55.20309 62.20729 55.87725 55.56250 56.76317 55.71042
[9] 53.18075 55.04853
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.54589 70.61960 71.73569 70.02758 72.66207 67.76595 72.15287
[8] 71.22215 66.07394 64.53260 70.35943 70.68174 73.66706 66.20897
[15] 73.72770 71.77009 71.19471 71.56365 72.46903 74.00515
> colSums(tmp5,na.rm=TRUE)
[1] 1125.4589 706.1960 717.3569 700.2758 726.6207 677.6595 721.5287
[8] 712.2215 660.7394 645.3260 703.5943 706.8174 736.6706 662.0897
[15] 737.2770 645.9308 711.9471 715.6365 724.6903 740.0515
> colVars(tmp5,na.rm=TRUE)
[1] 16089.20596 132.50321 91.41225 70.76606 81.61531 37.51561
[7] 43.48625 29.42716 81.70021 73.06964 101.95806 78.66644
[13] 70.50171 101.73338 28.69027 167.03944 67.52616 86.39831
[19] 47.00267 112.89978
> colSd(tmp5,na.rm=TRUE)
[1] 126.843234 11.511004 9.560975 8.412257 9.034119 6.124999
[7] 6.594411 5.424681 9.038817 8.548078 10.097428 8.869410
[13] 8.396529 10.086296 5.356330 12.924374 8.217430 9.295069
[19] 6.855849 10.625431
> colMax(tmp5,na.rm=TRUE)
[1] 472.63206 84.11055 85.06390 88.30495 84.00617 77.49058 84.37191
[8] 80.79645 85.44691 78.46869 90.64354 84.06139 85.27557 81.37623
[15] 81.44150 92.76790 87.48001 84.08072 80.62887 88.50209
> colMin(tmp5,na.rm=TRUE)
[1] 60.09695 53.18075 54.10659 57.94661 55.87725 59.39594 64.93866 60.99950
[9] 57.12632 55.71042 57.04607 55.56250 59.77902 55.20309 66.87598 59.55972
[17] 56.76317 55.04853 61.28739 57.49018
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] NaN 69.95970 73.60406 72.06326 70.65621 70.32242 70.43457 70.08986
[9] 67.19855 72.86723
> rowSums(tmp5,na.rm=TRUE)
[1] 0.000 1399.194 1472.081 1441.265 1413.124 1406.448 1408.691 1401.797
[9] 1343.971 1457.345
> rowVars(tmp5,na.rm=TRUE)
[1] NA 58.28148 92.89418 54.89297 93.50537 92.57313 89.52685 86.60220
[9] 84.31279 82.99643
> rowSd(tmp5,na.rm=TRUE)
[1] NA 7.634231 9.638163 7.408979 9.669817 9.621493 9.461863 9.306030
[9] 9.182200 9.110237
> rowMax(tmp5,na.rm=TRUE)
[1] NA 84.16651 88.50209 83.72986 90.64354 87.48001 84.84995 92.76790
[9] 84.06139 90.76519
> rowMin(tmp5,na.rm=TRUE)
[1] NA 59.73209 55.20309 62.20729 55.87725 55.56250 56.76317 55.71042
[9] 53.18075 55.04853
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 72.53632 70.73526 71.20110 69.09363 72.33582 68.69595 71.78740 72.35799
[9] 65.55579 64.58337 71.52865 70.51647 74.00132 67.31391 74.39711 NaN
[17] 70.56914 70.91776 71.78681 74.30690
> colSums(tmp5,na.rm=TRUE)
[1] 652.8269 636.6173 640.8099 621.8426 651.0224 618.2636 646.0866 651.2220
[9] 590.0021 581.2504 643.7578 634.6483 666.0119 605.8252 669.5739 0.0000
[17] 635.1222 638.2599 646.0813 668.7621
> colVars(tmp5,na.rm=TRUE)
[1] 91.73848 148.91561 99.62372 69.79876 90.61982 32.47490 47.41944
[8] 18.59131 88.89230 82.17435 99.32333 88.19245 78.05739 100.71493
[15] 27.23539 NA 71.56442 92.50489 47.64191 125.98793
> colSd(tmp5,na.rm=TRUE)
[1] 9.578021 12.203098 9.981168 8.354565 9.519444 5.698676 6.886178
[8] 4.311765 9.428271 9.065007 9.966109 9.391084 8.835010 10.035683
[15] 5.218754 NA 8.459576 9.617946 6.902312 11.224434
> colMax(tmp5,na.rm=TRUE)
[1] 84.16651 84.11055 85.06390 88.30495 84.00617 77.49058 84.37191 80.79645
[9] 85.44691 78.46869 90.64354 84.06139 85.27557 81.37623 81.44150 -Inf
[17] 87.48001 84.08072 80.62887 88.50209
> colMin(tmp5,na.rm=TRUE)
[1] 60.09695 53.18075 54.10659 57.94661 55.87725 59.50410 64.93866 65.05856
[9] 57.12632 55.71042 57.04607 55.56250 59.77902 55.20309 66.87598 Inf
[17] 56.76317 55.04853 61.28739 57.49018
>
>
>
>
> 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] 207.2316 302.7846 224.3559 273.0215 184.9439 322.0871 289.5118 222.0718
[9] 391.4042 148.4961
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 207.2316 302.7846 224.3559 273.0215 184.9439 322.0871 289.5118 222.0718
[9] 391.4042 148.4961
>
>
>
> 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] -5.684342e-14 2.842171e-14 1.421085e-13 0.000000e+00 0.000000e+00
[6] -5.684342e-14 -2.842171e-14 1.136868e-13 1.705303e-13 5.684342e-14
[11] -7.105427e-14 0.000000e+00 -5.684342e-14 -5.684342e-14 0.000000e+00
[16] -3.410605e-13 4.263256e-14 -2.273737e-13 -1.705303e-13 1.989520e-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)
+ }
7 14
6 6
8 9
7 13
9 4
3 15
2 7
6 15
9 14
7 6
1 6
1 13
8 3
5 7
5 2
2 19
7 4
4 3
5 19
10 2
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.804702
> Min(tmp)
[1] -2.36055
> mean(tmp)
[1] -0.06127761
> Sum(tmp)
[1] -6.127761
> Var(tmp)
[1] 1.342287
>
> rowMeans(tmp)
[1] -0.06127761
> rowSums(tmp)
[1] -6.127761
> rowVars(tmp)
[1] 1.342287
> rowSd(tmp)
[1] 1.158571
> rowMax(tmp)
[1] 2.804702
> rowMin(tmp)
[1] -2.36055
>
> colMeans(tmp)
[1] 0.435483392 -1.394979285 -1.097006406 -1.451837190 -0.703316488
[6] -0.169914725 2.804702370 0.008629126 -0.936451985 1.100075099
[11] -0.426547249 1.961345679 -1.258118640 0.175561227 -1.472733865
[16] -1.266153718 0.152525372 1.274304669 0.630455982 -0.070758590
[21] 0.530989390 -0.631631062 0.286315348 -1.064794990 1.151978272
[26] -0.595046314 -0.803948425 -0.621618972 -1.233279230 0.116520829
[31] -2.047495486 2.259426302 1.484584829 0.092416092 2.081282809
[36] 1.161018265 -0.084671933 -1.876561103 -1.126017693 -0.416326320
[41] -0.166628893 2.055395042 -0.235415581 -0.093256319 0.401342468
[46] 0.177912646 0.453355579 -0.638037060 -0.877480062 0.074731554
[51] -1.076376081 0.104762792 -2.159831977 -1.575534949 0.595651272
[56] 0.016705409 2.325535886 -0.603638168 -1.375315074 -2.360550193
[61] -0.511229219 -1.303697757 0.655729887 0.115064582 1.091677032
[66] 1.232719690 0.085941418 0.287482486 -0.893554266 1.617344622
[71] -1.602989958 0.992823504 -0.715875579 -0.193757122 2.043216331
[76] 0.584819884 -0.827863654 -0.159383782 1.300274618 -0.753392654
[81] 1.830026320 -1.301353638 1.361643767 1.162634246 0.381046235
[86] -1.776463159 0.822369337 2.008589252 0.144124274 -0.879533080
[91] -0.196752351 0.667371414 -0.985545554 -1.715059301 0.275675680
[96] -1.370176383 0.225391754 -0.862997957 -2.045981326 1.080146074
> colSums(tmp)
[1] 0.435483392 -1.394979285 -1.097006406 -1.451837190 -0.703316488
[6] -0.169914725 2.804702370 0.008629126 -0.936451985 1.100075099
[11] -0.426547249 1.961345679 -1.258118640 0.175561227 -1.472733865
[16] -1.266153718 0.152525372 1.274304669 0.630455982 -0.070758590
[21] 0.530989390 -0.631631062 0.286315348 -1.064794990 1.151978272
[26] -0.595046314 -0.803948425 -0.621618972 -1.233279230 0.116520829
[31] -2.047495486 2.259426302 1.484584829 0.092416092 2.081282809
[36] 1.161018265 -0.084671933 -1.876561103 -1.126017693 -0.416326320
[41] -0.166628893 2.055395042 -0.235415581 -0.093256319 0.401342468
[46] 0.177912646 0.453355579 -0.638037060 -0.877480062 0.074731554
[51] -1.076376081 0.104762792 -2.159831977 -1.575534949 0.595651272
[56] 0.016705409 2.325535886 -0.603638168 -1.375315074 -2.360550193
[61] -0.511229219 -1.303697757 0.655729887 0.115064582 1.091677032
[66] 1.232719690 0.085941418 0.287482486 -0.893554266 1.617344622
[71] -1.602989958 0.992823504 -0.715875579 -0.193757122 2.043216331
[76] 0.584819884 -0.827863654 -0.159383782 1.300274618 -0.753392654
[81] 1.830026320 -1.301353638 1.361643767 1.162634246 0.381046235
[86] -1.776463159 0.822369337 2.008589252 0.144124274 -0.879533080
[91] -0.196752351 0.667371414 -0.985545554 -1.715059301 0.275675680
[96] -1.370176383 0.225391754 -0.862997957 -2.045981326 1.080146074
> 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.435483392 -1.394979285 -1.097006406 -1.451837190 -0.703316488
[6] -0.169914725 2.804702370 0.008629126 -0.936451985 1.100075099
[11] -0.426547249 1.961345679 -1.258118640 0.175561227 -1.472733865
[16] -1.266153718 0.152525372 1.274304669 0.630455982 -0.070758590
[21] 0.530989390 -0.631631062 0.286315348 -1.064794990 1.151978272
[26] -0.595046314 -0.803948425 -0.621618972 -1.233279230 0.116520829
[31] -2.047495486 2.259426302 1.484584829 0.092416092 2.081282809
[36] 1.161018265 -0.084671933 -1.876561103 -1.126017693 -0.416326320
[41] -0.166628893 2.055395042 -0.235415581 -0.093256319 0.401342468
[46] 0.177912646 0.453355579 -0.638037060 -0.877480062 0.074731554
[51] -1.076376081 0.104762792 -2.159831977 -1.575534949 0.595651272
[56] 0.016705409 2.325535886 -0.603638168 -1.375315074 -2.360550193
[61] -0.511229219 -1.303697757 0.655729887 0.115064582 1.091677032
[66] 1.232719690 0.085941418 0.287482486 -0.893554266 1.617344622
[71] -1.602989958 0.992823504 -0.715875579 -0.193757122 2.043216331
[76] 0.584819884 -0.827863654 -0.159383782 1.300274618 -0.753392654
[81] 1.830026320 -1.301353638 1.361643767 1.162634246 0.381046235
[86] -1.776463159 0.822369337 2.008589252 0.144124274 -0.879533080
[91] -0.196752351 0.667371414 -0.985545554 -1.715059301 0.275675680
[96] -1.370176383 0.225391754 -0.862997957 -2.045981326 1.080146074
> colMin(tmp)
[1] 0.435483392 -1.394979285 -1.097006406 -1.451837190 -0.703316488
[6] -0.169914725 2.804702370 0.008629126 -0.936451985 1.100075099
[11] -0.426547249 1.961345679 -1.258118640 0.175561227 -1.472733865
[16] -1.266153718 0.152525372 1.274304669 0.630455982 -0.070758590
[21] 0.530989390 -0.631631062 0.286315348 -1.064794990 1.151978272
[26] -0.595046314 -0.803948425 -0.621618972 -1.233279230 0.116520829
[31] -2.047495486 2.259426302 1.484584829 0.092416092 2.081282809
[36] 1.161018265 -0.084671933 -1.876561103 -1.126017693 -0.416326320
[41] -0.166628893 2.055395042 -0.235415581 -0.093256319 0.401342468
[46] 0.177912646 0.453355579 -0.638037060 -0.877480062 0.074731554
[51] -1.076376081 0.104762792 -2.159831977 -1.575534949 0.595651272
[56] 0.016705409 2.325535886 -0.603638168 -1.375315074 -2.360550193
[61] -0.511229219 -1.303697757 0.655729887 0.115064582 1.091677032
[66] 1.232719690 0.085941418 0.287482486 -0.893554266 1.617344622
[71] -1.602989958 0.992823504 -0.715875579 -0.193757122 2.043216331
[76] 0.584819884 -0.827863654 -0.159383782 1.300274618 -0.753392654
[81] 1.830026320 -1.301353638 1.361643767 1.162634246 0.381046235
[86] -1.776463159 0.822369337 2.008589252 0.144124274 -0.879533080
[91] -0.196752351 0.667371414 -0.985545554 -1.715059301 0.275675680
[96] -1.370176383 0.225391754 -0.862997957 -2.045981326 1.080146074
> colMedians(tmp)
[1] 0.435483392 -1.394979285 -1.097006406 -1.451837190 -0.703316488
[6] -0.169914725 2.804702370 0.008629126 -0.936451985 1.100075099
[11] -0.426547249 1.961345679 -1.258118640 0.175561227 -1.472733865
[16] -1.266153718 0.152525372 1.274304669 0.630455982 -0.070758590
[21] 0.530989390 -0.631631062 0.286315348 -1.064794990 1.151978272
[26] -0.595046314 -0.803948425 -0.621618972 -1.233279230 0.116520829
[31] -2.047495486 2.259426302 1.484584829 0.092416092 2.081282809
[36] 1.161018265 -0.084671933 -1.876561103 -1.126017693 -0.416326320
[41] -0.166628893 2.055395042 -0.235415581 -0.093256319 0.401342468
[46] 0.177912646 0.453355579 -0.638037060 -0.877480062 0.074731554
[51] -1.076376081 0.104762792 -2.159831977 -1.575534949 0.595651272
[56] 0.016705409 2.325535886 -0.603638168 -1.375315074 -2.360550193
[61] -0.511229219 -1.303697757 0.655729887 0.115064582 1.091677032
[66] 1.232719690 0.085941418 0.287482486 -0.893554266 1.617344622
[71] -1.602989958 0.992823504 -0.715875579 -0.193757122 2.043216331
[76] 0.584819884 -0.827863654 -0.159383782 1.300274618 -0.753392654
[81] 1.830026320 -1.301353638 1.361643767 1.162634246 0.381046235
[86] -1.776463159 0.822369337 2.008589252 0.144124274 -0.879533080
[91] -0.196752351 0.667371414 -0.985545554 -1.715059301 0.275675680
[96] -1.370176383 0.225391754 -0.862997957 -2.045981326 1.080146074
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.4354834 -1.394979 -1.097006 -1.451837 -0.7033165 -0.1699147 2.804702
[2,] 0.4354834 -1.394979 -1.097006 -1.451837 -0.7033165 -0.1699147 2.804702
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.008629126 -0.936452 1.100075 -0.4265472 1.961346 -1.258119 0.1755612
[2,] 0.008629126 -0.936452 1.100075 -0.4265472 1.961346 -1.258119 0.1755612
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.472734 -1.266154 0.1525254 1.274305 0.630456 -0.07075859 0.5309894
[2,] -1.472734 -1.266154 0.1525254 1.274305 0.630456 -0.07075859 0.5309894
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.6316311 0.2863153 -1.064795 1.151978 -0.5950463 -0.8039484 -0.621619
[2,] -0.6316311 0.2863153 -1.064795 1.151978 -0.5950463 -0.8039484 -0.621619
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.233279 0.1165208 -2.047495 2.259426 1.484585 0.09241609 2.081283
[2,] -1.233279 0.1165208 -2.047495 2.259426 1.484585 0.09241609 2.081283
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.161018 -0.08467193 -1.876561 -1.126018 -0.4163263 -0.1666289 2.055395
[2,] 1.161018 -0.08467193 -1.876561 -1.126018 -0.4163263 -0.1666289 2.055395
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.2354156 -0.09325632 0.4013425 0.1779126 0.4533556 -0.6380371 -0.8774801
[2,] -0.2354156 -0.09325632 0.4013425 0.1779126 0.4533556 -0.6380371 -0.8774801
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.07473155 -1.076376 0.1047628 -2.159832 -1.575535 0.5956513 0.01670541
[2,] 0.07473155 -1.076376 0.1047628 -2.159832 -1.575535 0.5956513 0.01670541
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 2.325536 -0.6036382 -1.375315 -2.36055 -0.5112292 -1.303698 0.6557299
[2,] 2.325536 -0.6036382 -1.375315 -2.36055 -0.5112292 -1.303698 0.6557299
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.1150646 1.091677 1.23272 0.08594142 0.2874825 -0.8935543 1.617345
[2,] 0.1150646 1.091677 1.23272 0.08594142 0.2874825 -0.8935543 1.617345
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.60299 0.9928235 -0.7158756 -0.1937571 2.043216 0.5848199 -0.8278637
[2,] -1.60299 0.9928235 -0.7158756 -0.1937571 2.043216 0.5848199 -0.8278637
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1593838 1.300275 -0.7533927 1.830026 -1.301354 1.361644 1.162634
[2,] -0.1593838 1.300275 -0.7533927 1.830026 -1.301354 1.361644 1.162634
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.3810462 -1.776463 0.8223693 2.008589 0.1441243 -0.8795331 -0.1967524
[2,] 0.3810462 -1.776463 0.8223693 2.008589 0.1441243 -0.8795331 -0.1967524
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.6673714 -0.9855456 -1.715059 0.2756757 -1.370176 0.2253918 -0.862998
[2,] 0.6673714 -0.9855456 -1.715059 0.2756757 -1.370176 0.2253918 -0.862998
[,99] [,100]
[1,] -2.045981 1.080146
[2,] -2.045981 1.080146
>
>
> Max(tmp2)
[1] 2.42579
> Min(tmp2)
[1] -3.801922
> mean(tmp2)
[1] -0.06747862
> Sum(tmp2)
[1] -6.747862
> Var(tmp2)
[1] 1.022271
>
> rowMeans(tmp2)
[1] -0.55636482 -0.04418933 0.18449765 -0.40958257 0.36385552 1.02829458
[7] -0.27788382 1.65622142 -1.16601743 0.40774679 -0.72447983 0.26363237
[13] 0.68946527 1.30384509 1.14306697 -0.40955185 -0.61931593 1.72024063
[19] -0.30558978 -0.64281133 -0.81075707 0.06033842 0.52944394 1.21077173
[25] 0.00966086 0.07391369 0.65896915 0.42331611 1.31629633 0.38817049
[31] 0.14596520 -1.16510866 0.75466702 -0.16382494 0.40225489 -1.07791257
[37] -1.52714437 0.01116286 -1.52439476 0.42333543 0.29643078 -0.45572627
[43] 0.14152124 -1.76712174 0.48491103 -0.20825422 -3.80192237 -0.01315906
[49] -1.19412671 -0.78238435 0.56649554 -0.91417454 -1.88579456 -0.53930006
[55] 0.27439766 -0.51021530 -0.37535161 -0.89979275 -1.39944341 0.16946083
[61] 0.09947160 -1.63584136 -0.33204073 -2.76364158 0.36094404 -0.16701647
[67] 0.24729379 -0.75932314 0.11143338 -0.37406840 -1.68659793 -0.71056415
[73] 0.25969538 0.40378986 -0.64229913 -0.69404773 0.50923527 1.50664814
[79] 0.91764300 1.09822651 -2.14392970 0.22220355 1.52770197 -0.81943034
[85] -0.68808075 -0.72607744 1.25165015 1.06553543 0.48734510 0.79867048
[91] 1.87529822 -0.27324004 2.42578991 1.36302615 -0.95487523 0.57260502
[97] -0.12870395 0.18715147 0.79352787 -0.26362399
> rowSums(tmp2)
[1] -0.55636482 -0.04418933 0.18449765 -0.40958257 0.36385552 1.02829458
[7] -0.27788382 1.65622142 -1.16601743 0.40774679 -0.72447983 0.26363237
[13] 0.68946527 1.30384509 1.14306697 -0.40955185 -0.61931593 1.72024063
[19] -0.30558978 -0.64281133 -0.81075707 0.06033842 0.52944394 1.21077173
[25] 0.00966086 0.07391369 0.65896915 0.42331611 1.31629633 0.38817049
[31] 0.14596520 -1.16510866 0.75466702 -0.16382494 0.40225489 -1.07791257
[37] -1.52714437 0.01116286 -1.52439476 0.42333543 0.29643078 -0.45572627
[43] 0.14152124 -1.76712174 0.48491103 -0.20825422 -3.80192237 -0.01315906
[49] -1.19412671 -0.78238435 0.56649554 -0.91417454 -1.88579456 -0.53930006
[55] 0.27439766 -0.51021530 -0.37535161 -0.89979275 -1.39944341 0.16946083
[61] 0.09947160 -1.63584136 -0.33204073 -2.76364158 0.36094404 -0.16701647
[67] 0.24729379 -0.75932314 0.11143338 -0.37406840 -1.68659793 -0.71056415
[73] 0.25969538 0.40378986 -0.64229913 -0.69404773 0.50923527 1.50664814
[79] 0.91764300 1.09822651 -2.14392970 0.22220355 1.52770197 -0.81943034
[85] -0.68808075 -0.72607744 1.25165015 1.06553543 0.48734510 0.79867048
[91] 1.87529822 -0.27324004 2.42578991 1.36302615 -0.95487523 0.57260502
[97] -0.12870395 0.18715147 0.79352787 -0.26362399
> 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.55636482 -0.04418933 0.18449765 -0.40958257 0.36385552 1.02829458
[7] -0.27788382 1.65622142 -1.16601743 0.40774679 -0.72447983 0.26363237
[13] 0.68946527 1.30384509 1.14306697 -0.40955185 -0.61931593 1.72024063
[19] -0.30558978 -0.64281133 -0.81075707 0.06033842 0.52944394 1.21077173
[25] 0.00966086 0.07391369 0.65896915 0.42331611 1.31629633 0.38817049
[31] 0.14596520 -1.16510866 0.75466702 -0.16382494 0.40225489 -1.07791257
[37] -1.52714437 0.01116286 -1.52439476 0.42333543 0.29643078 -0.45572627
[43] 0.14152124 -1.76712174 0.48491103 -0.20825422 -3.80192237 -0.01315906
[49] -1.19412671 -0.78238435 0.56649554 -0.91417454 -1.88579456 -0.53930006
[55] 0.27439766 -0.51021530 -0.37535161 -0.89979275 -1.39944341 0.16946083
[61] 0.09947160 -1.63584136 -0.33204073 -2.76364158 0.36094404 -0.16701647
[67] 0.24729379 -0.75932314 0.11143338 -0.37406840 -1.68659793 -0.71056415
[73] 0.25969538 0.40378986 -0.64229913 -0.69404773 0.50923527 1.50664814
[79] 0.91764300 1.09822651 -2.14392970 0.22220355 1.52770197 -0.81943034
[85] -0.68808075 -0.72607744 1.25165015 1.06553543 0.48734510 0.79867048
[91] 1.87529822 -0.27324004 2.42578991 1.36302615 -0.95487523 0.57260502
[97] -0.12870395 0.18715147 0.79352787 -0.26362399
> rowMin(tmp2)
[1] -0.55636482 -0.04418933 0.18449765 -0.40958257 0.36385552 1.02829458
[7] -0.27788382 1.65622142 -1.16601743 0.40774679 -0.72447983 0.26363237
[13] 0.68946527 1.30384509 1.14306697 -0.40955185 -0.61931593 1.72024063
[19] -0.30558978 -0.64281133 -0.81075707 0.06033842 0.52944394 1.21077173
[25] 0.00966086 0.07391369 0.65896915 0.42331611 1.31629633 0.38817049
[31] 0.14596520 -1.16510866 0.75466702 -0.16382494 0.40225489 -1.07791257
[37] -1.52714437 0.01116286 -1.52439476 0.42333543 0.29643078 -0.45572627
[43] 0.14152124 -1.76712174 0.48491103 -0.20825422 -3.80192237 -0.01315906
[49] -1.19412671 -0.78238435 0.56649554 -0.91417454 -1.88579456 -0.53930006
[55] 0.27439766 -0.51021530 -0.37535161 -0.89979275 -1.39944341 0.16946083
[61] 0.09947160 -1.63584136 -0.33204073 -2.76364158 0.36094404 -0.16701647
[67] 0.24729379 -0.75932314 0.11143338 -0.37406840 -1.68659793 -0.71056415
[73] 0.25969538 0.40378986 -0.64229913 -0.69404773 0.50923527 1.50664814
[79] 0.91764300 1.09822651 -2.14392970 0.22220355 1.52770197 -0.81943034
[85] -0.68808075 -0.72607744 1.25165015 1.06553543 0.48734510 0.79867048
[91] 1.87529822 -0.27324004 2.42578991 1.36302615 -0.95487523 0.57260502
[97] -0.12870395 0.18715147 0.79352787 -0.26362399
>
> colMeans(tmp2)
[1] -0.06747862
> colSums(tmp2)
[1] -6.747862
> colVars(tmp2)
[1] 1.022271
> colSd(tmp2)
[1] 1.011074
> colMax(tmp2)
[1] 2.42579
> colMin(tmp2)
[1] -3.801922
> colMedians(tmp2)
[1] 0.03575064
> colRanges(tmp2)
[,1]
[1,] -3.801922
[2,] 2.425790
>
> 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.09982558 -1.97235033 1.18258688 0.90598709 -2.04434656 5.26888246
[7] 5.37706885 -4.18895990 3.34960589 -3.02786931
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8669997
[2,] -1.0552066
[3,] 0.2533073
[4,] 0.8979544
[5,] 1.7891845
>
> rowApply(tmp,sum)
[1] 0.3006056 4.3666982 -0.6974536 5.2105329 1.4089259 -3.5945727
[7] 1.5497766 3.1790860 -3.9449757 -2.8281925
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 7 10 3 1 2 7 6 7 2
[2,] 2 5 9 7 8 3 1 5 9 6
[3,] 4 2 7 1 10 10 8 7 6 4
[4,] 5 6 6 10 3 5 5 8 8 1
[5,] 3 1 4 5 5 7 2 10 1 8
[6,] 8 8 8 8 4 4 10 3 5 9
[7,] 6 4 2 9 7 9 9 4 4 10
[8,] 10 10 1 2 2 1 3 2 3 5
[9,] 7 9 3 4 6 8 6 9 10 3
[10,] 1 3 5 6 9 6 4 1 2 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.6931840 2.2885037 2.6511233 1.6917929 1.7086963 -3.0944180
[7] 1.3638493 4.0972319 1.3023978 -2.2984772 1.6662286 -1.4083671
[13] -0.0291333 4.7854071 2.2510215 1.7450699 4.4118588 -2.4062914
[19] -0.3988012 -2.1516208
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.6119967
[2,] -0.6073540
[3,] -0.3193638
[4,] 0.9511881
[5,] 1.8943424
>
> rowApply(tmp,sum)
[1] 3.272918 -5.777139 3.098563 5.321832 11.566714
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 18 3 1 20
[2,] 7 20 10 15 4
[3,] 9 17 2 17 18
[4,] 6 19 6 8 15
[5,] 18 2 12 18 6
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.3193638 -0.40303846 -0.2554908 -0.5154747 1.4038954 -0.04913546
[2,] 0.9511881 1.82225292 0.7007049 1.2118818 -1.9955149 -1.69903003
[3,] -0.6073540 0.02662483 -0.7408405 -0.3286499 0.3172147 -0.41477539
[4,] -2.6119967 0.91241550 1.1576873 0.1811247 1.6549558 -1.44288033
[5,] 1.8943424 -0.06975112 1.7890625 1.1429110 0.3281453 0.51140322
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.5932402 1.3453523 -1.0758783 0.8518834 0.93512080 -1.0872323
[2,] 0.6902430 -0.6845906 0.1677179 -0.2979449 0.17968459 -0.3612939
[3,] 1.0247199 0.9187694 1.5698926 -2.3641765 -0.06530270 -0.1178521
[4,] -1.6083050 0.7327718 0.1506121 -1.2830163 0.65589336 0.7584800
[5,] 1.8504316 1.7849289 0.4900535 0.7947772 -0.03916748 -0.6004688
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.06527087 1.7293042 -0.12989574 0.42333536 2.0562690 0.6670975
[2,] -1.41088318 -0.7293269 -0.08164939 0.50812836 -0.9997036 -0.3996640
[3,] -0.03996076 1.3794380 0.46685967 0.09768468 0.7108752 0.7750873
[4,] 1.00238120 0.8748574 0.91022193 -0.31595699 1.6587815 -1.0563346
[5,] 0.35405857 1.5311344 1.08548505 1.03187851 0.9856367 -2.3924776
[,19] [,20]
[1,] -1.0732553 -0.7026059
[2,] -1.3265300 -2.0228093
[3,] 1.0593259 -0.5690172
[4,] 0.5884003 2.4017392
[5,] 0.3532580 -1.2589276
>
>
> 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 0.6532866 0.4847458 0.238949 1.185455 -0.9340036 -2.498487 -0.4647817
col8 col9 col10 col11 col12 col13 col14
row1 -0.2834949 0.249017 0.2751692 2.022761 1.31349 1.516879 -1.299141
col15 col16 col17 col18 col19 col20
row1 -0.2430378 0.4875854 -0.4444185 -0.4244919 1.337555 0.494699
> tmp[,"col10"]
col10
row1 0.2751692
row2 -0.1238387
row3 -1.1492065
row4 0.2292013
row5 1.3381514
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.65328656 0.4847458 0.238949 1.1854546 -0.9340036 -2.4984869
row5 -0.05251162 -1.1240149 1.023919 -0.2568759 -0.9100149 0.3954097
col7 col8 col9 col10 col11 col12 col13
row1 -0.4647817 -0.2834949 0.2490170 0.2751692 2.022761 1.313490 1.516879
row5 -0.5135479 0.3122516 0.6965399 1.3381514 -2.067666 1.404692 1.193284
col14 col15 col16 col17 col18 col19
row1 -1.2991412295 -0.2430378 0.48758543 -0.4444185 -0.4244919 1.3375548
row5 -0.0001026933 1.0134685 0.02347242 0.5563742 1.8092370 0.3437603
col20
row1 0.49469902
row5 -0.07113771
> tmp[,c("col6","col20")]
col6 col20
row1 -2.4984869 0.49469902
row2 -0.4881375 0.33479013
row3 0.3482995 -0.86827864
row4 -0.1647101 -2.90069962
row5 0.3954097 -0.07113771
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -2.4984869 0.49469902
row5 0.3954097 -0.07113771
>
>
>
>
> 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 47.74687 49.88498 50.86434 49.01024 49.92198 106.7971 49.79729 51.09796
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.20883 49.6083 49.82023 50.27858 47.29933 48.87819 51.59104 48.98472
col17 col18 col19 col20
row1 49.39258 49.20073 48.00361 105.5342
> tmp[,"col10"]
col10
row1 49.60830
row2 28.16477
row3 27.03701
row4 29.15471
row5 51.01081
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 47.74687 49.88498 50.86434 49.01024 49.92198 106.7971 49.79729 51.09796
row5 49.91123 51.22853 50.58977 51.04193 50.36494 106.5533 48.08531 50.38043
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.20883 49.60830 49.82023 50.27858 47.29933 48.87819 51.59104 48.98472
row5 49.59232 51.01081 50.72272 49.83891 49.15982 50.52129 50.09808 48.81816
col17 col18 col19 col20
row1 49.39258 49.20073 48.00361 105.5342
row5 50.13229 50.49015 50.63220 106.2028
> tmp[,c("col6","col20")]
col6 col20
row1 106.79707 105.53420
row2 75.22985 76.72820
row3 76.63859 72.94842
row4 74.45968 75.17792
row5 106.55331 106.20275
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.7971 105.5342
row5 106.5533 106.2028
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.7971 105.5342
row5 106.5533 106.2028
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.1778963
[2,] -0.9031034
[3,] -0.8902332
[4,] -1.7023652
[5,] -0.1292793
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.0855064 1.7005249
[2,] 0.2188021 0.2319987
[3,] -0.7411513 0.7722258
[4,] 0.1748617 0.2122249
[5,] -0.4391971 1.3737898
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.4801340 -0.3895215
[2,] 0.3462504 0.7710230
[3,] 0.2837621 -0.7823781
[4,] 0.5126983 0.1080061
[5,] 0.2896397 0.5780592
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.480134
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.4801340
[2,] 0.3462504
>
>
>
> 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.7476989 1.3483812 0.09396841 -0.3236857 0.1883435 -1.250370 -0.4257029
row1 -0.4194185 0.5837023 0.30372708 0.3669154 0.4889522 -1.529069 1.0745608
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.1818016 -0.08180875 -0.6693774 1.107083 0.8720863 -0.6734145
row1 -0.9258500 1.07408521 -2.9971928 1.593995 -3.2216460 -0.1876814
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.3231944 -1.259871 -0.8773074 -0.04510829 0.8328749 -0.6129874
row1 -0.7651759 -1.253310 -1.4008675 -2.00725954 -0.8683577 -0.5940344
[,20]
row3 -0.9806474
row1 -0.2232841
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.06373359 -0.8494151 1.486645 -0.1807163 1.424849 0.274392 -1.229543
[,8] [,9] [,10]
row2 -1.039913 0.5808942 -0.461581
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row5 -0.2594065 0.4316465 -0.8921264 0.07340422 0.6505321 -0.08150119
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row5 -0.9280687 0.4164547 -0.03257271 -1.462609 1.172731 -0.9855652 -0.2965181
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.080212 0.7381269 -1.025484 0.2142493 -0.1647329 0.9453166 0.5949832
>
>
> 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: 0x600000d10000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af72ff45e7"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af55467bac"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af66184f1"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af6c5eed7c"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af4c399f79"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af5b14e807"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af398d5248"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af6d15127c"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af270c2d7"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af3907b281"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af28585067"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af3e06aee2"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af28c3973e"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af40fe7c5a"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc4af3961a0c"
>
>
> ### 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: 0x600000d141e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000d141e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600000d141e0>
> rowMedians(tmp)
[1] 0.082134962 0.290190650 0.591641792 -0.333478052 0.001736926
[6] 0.383712121 -0.065936212 -0.177657903 0.253856137 -0.273508950
[11] 0.074438464 0.096598469 -0.434475855 0.361040606 0.303903771
[16] -0.196522211 -0.305394902 0.408413731 -0.240089373 0.017758541
[21] 0.076494247 -0.198443432 0.331740050 -0.142282287 0.623032388
[26] 0.201441734 -0.055809665 0.495865257 0.438460172 -0.421382864
[31] -0.154202747 0.701376134 -0.225307633 1.026299726 0.183425446
[36] 0.282295818 0.106961182 0.006732246 -0.532863720 0.249008594
[41] 0.160432680 -0.488217091 0.074277443 0.661056932 -0.269322474
[46] 0.312574955 -0.440694175 -0.038766810 0.334094819 -0.287438458
[51] 0.500431616 0.159862385 0.134109772 0.102702510 -0.626924225
[56] 0.063109310 -0.032378856 -0.335433194 -0.087614167 -0.270071955
[61] 0.231515132 0.676017621 -0.398090301 -0.109735172 -0.183357461
[66] -0.044589417 -0.222632899 -0.121307900 -0.194235329 0.180610547
[71] 0.062096624 -0.237851034 -0.488442522 -0.037524287 0.287654610
[76] 0.004216444 -0.043605515 -0.056647876 0.037746694 0.174696931
[81] 0.206101221 -0.047744252 -0.051895623 -0.192714155 0.561085770
[86] -0.726785291 -0.106912819 0.604283273 -0.021061394 -0.234534761
[91] 0.304216119 0.401544969 0.353542843 0.009704113 0.100233800
[96] -0.276945430 -0.595383200 -0.007841767 0.092466164 0.064504329
[101] 0.586559482 -0.539798158 -0.370423712 0.081204040 -0.104143571
[106] 0.494258326 0.127532353 0.039954933 0.295666664 -0.209084611
[111] 0.151873327 -0.137986274 0.228291053 -0.228886170 -0.155043501
[116] 0.272482574 0.301455182 -0.215894564 0.419539624 -0.103445609
[121] 0.448350164 -0.074624616 -0.170784013 -0.252432954 -0.128917489
[126] 0.673386293 -0.290080192 0.338777517 -0.065284211 0.502140181
[131] 0.187689804 0.174121294 -0.554628295 0.232797217 0.170704509
[136] 0.623904621 -0.089753062 0.406302889 0.109609697 0.274056547
[141] 0.523309900 -0.650317428 0.251701377 0.032214121 -0.002861081
[146] 0.149811387 0.540777872 0.494393894 0.111730335 -0.136964925
[151] -0.026213658 -0.181933818 -0.415340845 -0.437905988 0.109867039
[156] -0.003134221 -0.223446880 0.316192237 -0.207243722 -0.060754580
[161] -0.177024505 0.074955306 0.346380508 0.344602281 0.139488577
[166] -0.361133203 -0.634612316 -0.020192231 -0.172559706 0.038664309
[171] -0.064040133 0.157165759 -0.495780236 -0.075532727 -0.317358358
[176] -0.645457747 -0.117493286 0.194192385 -0.294526818 -0.105097785
[181] -0.137128100 0.470614328 -0.267338490 0.137485195 -0.461027319
[186] 0.737211186 -0.111349568 0.283291058 -0.192800418 0.063719259
[191] -0.199020835 0.242576722 0.320653564 -0.156025570 0.127926516
[196] -0.530883453 -0.253196006 0.827480685 0.160349064 -0.408906258
[201] 0.230001778 0.201619980 0.461860063 0.363664805 0.321656326
[206] 0.096161050 -0.103066614 0.457190963 -0.132389998 0.488490849
[211] 0.021612378 -0.431872404 -0.344637252 0.091618200 -0.129547567
[216] -0.059050625 -0.433175508 -0.173720730 0.441096861 0.390788351
[221] 0.237342801 0.196820974 0.023738002 0.421337216 -0.299072508
[226] 0.107600616 0.409196987 0.136279617 0.622215611 0.452549284
>
> proc.time()
user system elapsed
5.043 18.488 25.400
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: 0x6000019d8000>
> .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: 0x6000019d8000>
> .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: 0x6000019d8000>
> .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: 0x6000019d8000>
> 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: 0x6000019d40c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d40c0>
> .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: 0x6000019d40c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d40c0>
> .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: 0x6000019d40c0>
> 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: 0x6000019d83c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d83c0>
> .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: 0x6000019d83c0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000019d83c0>
> .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: 0x6000019d83c0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000019d83c0>
> .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: 0x6000019d83c0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000019d83c0>
> .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: 0x6000019d83c0>
> 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: 0x6000019d85a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000019d85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d85a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec8e44ec90c33" "BufferedMatrixFilec8e4714010ad"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec8e44ec90c33" "BufferedMatrixFilec8e4714010ad"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d8840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d8840>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000019d8840>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000019d8840>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000019d8840>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000019d8840>
> .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: 0x6000019d8a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019d8a20>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000019d8a20>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000019d8a20>
> 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: 0x6000019ccc00>
> .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: 0x6000019ccc00>
> rm(P)
>
> proc.time()
user system elapsed
0.567 0.204 0.743
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.583 0.139 0.698