| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-10-25 12:04 -0400 (Sat, 25 Oct 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4901 |
| lconway | macOS 12.7.6 Monterey | x86_64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4691 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4637 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4658 |
| 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.73.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | NA | NA | ||||||||||
|
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.73.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.73.0.tar.gz |
| StartedAt: 2025-10-24 19:56:57 -0400 (Fri, 24 Oct 2025) |
| EndedAt: 2025-10-24 19:57:46 -0400 (Fri, 24 Oct 2025) |
| EllapsedTime: 49.7 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.73.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* 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.73.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.73.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.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.308 0.140 0.441
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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 480848 25.7 1056621 56.5 NA 634460 33.9
Vcells 891079 6.8 8388608 64.0 98304 2108715 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 Oct 24 19:57:20 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 Oct 24 19:57:21 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: 0x600003ed01e0>
>
>
>
> 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 Oct 24 19:57:25 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 Oct 24 19:57:26 2025"
>
> ColMode(tmp2)
<pointer: 0x600003ed01e0>
>
>
>
> ### 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.4771575 -0.3601024 1.1261738 0.7742589
[2,] 0.6260937 0.3189740 -2.5214030 0.5463373
[3,] -0.3183180 -0.2756804 -0.8732595 1.5764203
[4,] -0.9984254 0.1395241 2.6957283 -1.1140057
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.4771575 0.3601024 1.1261738 0.7742589
[2,] 0.6260937 0.3189740 2.5214030 0.5463373
[3,] 0.3183180 0.2756804 0.8732595 1.5764203
[4,] 0.9984254 0.1395241 2.6957283 1.1140057
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0238295 0.6000854 1.0612134 0.8799198
[2,] 0.7912609 0.5647778 1.5878926 0.7391463
[3,] 0.5641968 0.5250528 0.9344835 1.2555558
[4,] 0.9992124 0.3735293 1.6418673 1.0554647
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.71545 31.36096 36.73831 34.57346
[2,] 33.53870 30.96675 43.40033 32.93780
[3,] 30.96029 30.52621 35.21809 39.13198
[4,] 35.99055 28.87482 44.11440 36.66865
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003eb4000>
> exp(tmp5)
<pointer: 0x600003eb4000>
> log(tmp5,2)
<pointer: 0x600003eb4000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.7971
> Min(tmp5)
[1] 52.83215
> mean(tmp5)
[1] 73.41667
> Sum(tmp5)
[1] 14683.33
> Var(tmp5)
[1] 882.0349
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.21025 73.07905 73.07481 71.72197 71.82220 70.08394 71.04884 73.46924
[9] 68.88119 70.77526
> rowSums(tmp5)
[1] 1804.205 1461.581 1461.496 1434.439 1436.444 1401.679 1420.977 1469.385
[9] 1377.624 1415.505
> rowVars(tmp5)
[1] 8112.39133 115.43235 87.19902 102.92809 71.05470 59.73625
[7] 109.77306 68.06015 67.87426 94.30192
> rowSd(tmp5)
[1] 90.068814 10.743945 9.338041 10.145348 8.429395 7.728923 10.477264
[8] 8.249858 8.238583 9.710917
> rowMax(tmp5)
[1] 469.79714 92.94359 95.27034 91.81835 88.55001 79.80477 94.75654
[8] 86.61302 82.75954 89.85093
> rowMin(tmp5)
[1] 53.96275 55.22278 57.93024 55.06354 57.85016 52.83215 57.25832 56.94879
[9] 53.60410 58.17610
>
> colMeans(tmp5)
[1] 109.71578 66.99441 78.57019 71.05808 69.44482 68.77288 73.97684
[8] 70.73485 68.88107 70.75719 70.55311 69.11685 75.15578 69.23150
[15] 74.66421 75.64318 67.97135 69.55550 69.09704 78.43889
> colSums(tmp5)
[1] 1097.1578 669.9441 785.7019 710.5808 694.4482 687.7288 739.7684
[8] 707.3485 688.8107 707.5719 705.5311 691.1685 751.5578 692.3150
[15] 746.6421 756.4318 679.7135 695.5550 690.9704 784.3889
> colVars(tmp5)
[1] 16121.64242 25.62848 88.62896 44.23336 109.73392 138.59885
[7] 34.89523 128.65985 65.78956 80.19850 144.59617 82.23316
[13] 76.23218 56.95686 67.94778 136.89097 99.98424 104.08279
[19] 69.17636 42.58682
> colSd(tmp5)
[1] 126.971030 5.062457 9.414295 6.650817 10.475396 11.772801
[7] 5.907219 11.342833 8.111076 8.955361 12.024815 9.068250
[13] 8.731104 7.546977 8.243044 11.700041 9.999212 10.202098
[19] 8.317233 6.525858
> colMax(tmp5)
[1] 469.79714 74.38823 91.81835 81.44808 94.75654 86.86902 82.92625
[8] 92.94359 81.54081 77.47253 88.55001 82.71573 91.91284 84.71030
[15] 88.24421 95.27034 84.00101 86.61302 81.22370 88.49008
> colMin(tmp5)
[1] 56.94879 60.09915 60.76666 60.95914 56.95699 57.25832 61.04967 55.84739
[9] 58.17610 54.72302 54.37114 53.60410 61.90695 59.42979 62.03502 53.96275
[17] 55.22278 52.83215 56.10302 69.96621
>
>
> ### 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.21025 73.07905 NA 71.72197 71.82220 70.08394 71.04884 73.46924
[9] 68.88119 70.77526
> rowSums(tmp5)
[1] 1804.205 1461.581 NA 1434.439 1436.444 1401.679 1420.977 1469.385
[9] 1377.624 1415.505
> rowVars(tmp5)
[1] 8112.39133 115.43235 87.94330 102.92809 71.05470 59.73625
[7] 109.77306 68.06015 67.87426 94.30192
> rowSd(tmp5)
[1] 90.068814 10.743945 9.377809 10.145348 8.429395 7.728923 10.477264
[8] 8.249858 8.238583 9.710917
> rowMax(tmp5)
[1] 469.79714 92.94359 NA 91.81835 88.55001 79.80477 94.75654
[8] 86.61302 82.75954 89.85093
> rowMin(tmp5)
[1] 53.96275 55.22278 NA 55.06354 57.85016 52.83215 57.25832 56.94879
[9] 53.60410 58.17610
>
> colMeans(tmp5)
[1] 109.71578 66.99441 78.57019 NA 69.44482 68.77288 73.97684
[8] 70.73485 68.88107 70.75719 70.55311 69.11685 75.15578 69.23150
[15] 74.66421 75.64318 67.97135 69.55550 69.09704 78.43889
> colSums(tmp5)
[1] 1097.1578 669.9441 785.7019 NA 694.4482 687.7288 739.7684
[8] 707.3485 688.8107 707.5719 705.5311 691.1685 751.5578 692.3150
[15] 746.6421 756.4318 679.7135 695.5550 690.9704 784.3889
> colVars(tmp5)
[1] 16121.64242 25.62848 88.62896 NA 109.73392 138.59885
[7] 34.89523 128.65985 65.78956 80.19850 144.59617 82.23316
[13] 76.23218 56.95686 67.94778 136.89097 99.98424 104.08279
[19] 69.17636 42.58682
> colSd(tmp5)
[1] 126.971030 5.062457 9.414295 NA 10.475396 11.772801
[7] 5.907219 11.342833 8.111076 8.955361 12.024815 9.068250
[13] 8.731104 7.546977 8.243044 11.700041 9.999212 10.202098
[19] 8.317233 6.525858
> colMax(tmp5)
[1] 469.79714 74.38823 91.81835 NA 94.75654 86.86902 82.92625
[8] 92.94359 81.54081 77.47253 88.55001 82.71573 91.91284 84.71030
[15] 88.24421 95.27034 84.00101 86.61302 81.22370 88.49008
> colMin(tmp5)
[1] 56.94879 60.09915 60.76666 NA 56.95699 57.25832 61.04967 55.84739
[9] 58.17610 54.72302 54.37114 53.60410 61.90695 59.42979 62.03502 53.96275
[17] 55.22278 52.83215 56.10302 69.96621
>
> Max(tmp5,na.rm=TRUE)
[1] 469.7971
> Min(tmp5,na.rm=TRUE)
[1] 52.83215
> mean(tmp5,na.rm=TRUE)
[1] 73.37632
> Sum(tmp5,na.rm=TRUE)
[1] 14601.89
> Var(tmp5,na.rm=TRUE)
[1] 886.1622
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.21025 73.07905 72.63411 71.72197 71.82220 70.08394 71.04884 73.46924
[9] 68.88119 70.77526
> rowSums(tmp5,na.rm=TRUE)
[1] 1804.205 1461.581 1380.048 1434.439 1436.444 1401.679 1420.977 1469.385
[9] 1377.624 1415.505
> rowVars(tmp5,na.rm=TRUE)
[1] 8112.39133 115.43235 87.94330 102.92809 71.05470 59.73625
[7] 109.77306 68.06015 67.87426 94.30192
> rowSd(tmp5,na.rm=TRUE)
[1] 90.068814 10.743945 9.377809 10.145348 8.429395 7.728923 10.477264
[8] 8.249858 8.238583 9.710917
> rowMax(tmp5,na.rm=TRUE)
[1] 469.79714 92.94359 95.27034 91.81835 88.55001 79.80477 94.75654
[8] 86.61302 82.75954 89.85093
> rowMin(tmp5,na.rm=TRUE)
[1] 53.96275 55.22278 57.93024 55.06354 57.85016 52.83215 57.25832 56.94879
[9] 53.60410 58.17610
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.71578 66.99441 78.57019 69.90364 69.44482 68.77288 73.97684
[8] 70.73485 68.88107 70.75719 70.55311 69.11685 75.15578 69.23150
[15] 74.66421 75.64318 67.97135 69.55550 69.09704 78.43889
> colSums(tmp5,na.rm=TRUE)
[1] 1097.1578 669.9441 785.7019 629.1327 694.4482 687.7288 739.7684
[8] 707.3485 688.8107 707.5719 705.5311 691.1685 751.5578 692.3150
[15] 746.6421 756.4318 679.7135 695.5550 690.9704 784.3889
> colVars(tmp5,na.rm=TRUE)
[1] 16121.64242 25.62848 88.62896 34.76917 109.73392 138.59885
[7] 34.89523 128.65985 65.78956 80.19850 144.59617 82.23316
[13] 76.23218 56.95686 67.94778 136.89097 99.98424 104.08279
[19] 69.17636 42.58682
> colSd(tmp5,na.rm=TRUE)
[1] 126.971030 5.062457 9.414295 5.896539 10.475396 11.772801
[7] 5.907219 11.342833 8.111076 8.955361 12.024815 9.068250
[13] 8.731104 7.546977 8.243044 11.700041 9.999212 10.202098
[19] 8.317233 6.525858
> colMax(tmp5,na.rm=TRUE)
[1] 469.79714 74.38823 91.81835 79.06554 94.75654 86.86902 82.92625
[8] 92.94359 81.54081 77.47253 88.55001 82.71573 91.91284 84.71030
[15] 88.24421 95.27034 84.00101 86.61302 81.22370 88.49008
> colMin(tmp5,na.rm=TRUE)
[1] 56.94879 60.09915 60.76666 60.95914 56.95699 57.25832 61.04967 55.84739
[9] 58.17610 54.72302 54.37114 53.60410 61.90695 59.42979 62.03502 53.96275
[17] 55.22278 52.83215 56.10302 69.96621
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.21025 73.07905 NaN 71.72197 71.82220 70.08394 71.04884 73.46924
[9] 68.88119 70.77526
> rowSums(tmp5,na.rm=TRUE)
[1] 1804.205 1461.581 0.000 1434.439 1436.444 1401.679 1420.977 1469.385
[9] 1377.624 1415.505
> rowVars(tmp5,na.rm=TRUE)
[1] 8112.39133 115.43235 NA 102.92809 71.05470 59.73625
[7] 109.77306 68.06015 67.87426 94.30192
> rowSd(tmp5,na.rm=TRUE)
[1] 90.068814 10.743945 NA 10.145348 8.429395 7.728923 10.477264
[8] 8.249858 8.238583 9.710917
> rowMax(tmp5,na.rm=TRUE)
[1] 469.79714 92.94359 NA 91.81835 88.55001 79.80477 94.75654
[8] 86.61302 82.75954 89.85093
> rowMin(tmp5,na.rm=TRUE)
[1] 53.96275 55.22278 NA 55.06354 57.85016 52.83215 57.25832 56.94879
[9] 53.60410 58.17610
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.74644 67.37864 79.15556 NaN 69.87747 69.97762 73.83390
[8] 70.29524 68.94021 70.36456 68.67134 68.98506 75.75192 69.39595
[15] 75.16597 73.46239 66.19027 69.53115 69.69717 77.76868
> colSums(tmp5,na.rm=TRUE)
[1] 1032.7180 606.4078 712.4000 0.0000 628.8972 629.7986 664.5051
[8] 632.6572 620.4619 633.2811 618.0421 620.8655 681.7673 624.5635
[15] 676.4937 661.1615 595.7124 625.7804 627.2745 699.9181
> colVars(tmp5,na.rm=TRUE)
[1] 17852.13717 27.17113 95.85266 NA 121.34480 139.59551
[7] 39.02730 142.56828 73.97390 88.48903 122.83405 92.31692
[13] 81.76308 63.77221 73.60887 100.49883 76.79474 117.08647
[19] 73.77164 42.85687
> colSd(tmp5,na.rm=TRUE)
[1] 133.611890 5.212594 9.790437 NA 11.015662 11.815054
[7] 6.247184 11.940196 8.600808 9.406861 11.083052 9.608169
[13] 9.042294 7.985751 8.579561 10.024911 8.763261 10.820650
[19] 8.589042 6.546516
> colMax(tmp5,na.rm=TRUE)
[1] 469.79714 74.38823 91.81835 -Inf 94.75654 86.86902 82.92625
[8] 92.94359 81.54081 77.47253 88.55001 82.71573 91.91284 84.71030
[15] 88.24421 82.37563 76.94187 86.61302 81.22370 88.49008
> colMin(tmp5,na.rm=TRUE)
[1] 56.94879 60.09915 60.76666 Inf 56.95699 57.25832 61.04967 55.84739
[9] 58.17610 54.72302 54.37114 53.60410 61.90695 59.42979 62.03502 53.96275
[17] 55.22278 52.83215 56.10302 69.96621
>
>
>
>
> 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] 160.6552 371.6528 128.5096 198.3861 194.8558 273.3449 267.3361 203.8472
[9] 150.3746 161.5213
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 160.6552 371.6528 128.5096 198.3861 194.8558 273.3449 267.3361 203.8472
[9] 150.3746 161.5213
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.989520e-13 -1.421085e-13 -1.421085e-13 -8.526513e-14 0.000000e+00
[6] 1.705303e-13 -1.705303e-13 1.136868e-13 -8.526513e-14 2.842171e-14
[11] -5.684342e-14 -8.526513e-14 -1.847411e-13 0.000000e+00 1.705303e-13
[16] 1.136868e-13 -2.842171e-13 5.684342e-14 -9.947598e-14 1.136868e-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)
+ }
8 4
1 18
9 16
10 14
5 2
4 19
7 7
1 15
5 14
4 19
9 7
6 16
5 20
6 5
8 17
2 6
2 8
10 6
4 18
1 16
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.105664
> Min(tmp)
[1] -2.591707
> mean(tmp)
[1] -0.1193682
> Sum(tmp)
[1] -11.93682
> Var(tmp)
[1] 0.8806642
>
> rowMeans(tmp)
[1] -0.1193682
> rowSums(tmp)
[1] -11.93682
> rowVars(tmp)
[1] 0.8806642
> rowSd(tmp)
[1] 0.9384371
> rowMax(tmp)
[1] 2.105664
> rowMin(tmp)
[1] -2.591707
>
> colMeans(tmp)
[1] -0.805416660 0.314322813 2.105664056 -0.259895558 -1.837251281
[6] -1.105485251 -0.590372133 -0.615779172 -1.581474410 1.121589059
[11] 0.853911975 0.263855874 0.945684242 -0.636176874 -2.414183010
[16] 0.267779609 1.007434427 0.081217662 -0.040938965 0.044530904
[21] 0.348337235 0.083071447 -0.975442967 1.990752251 -1.957068803
[26] -0.082993538 -1.359960473 -1.755345185 0.057727128 0.114366257
[31] -0.187241182 -1.388812783 -1.227208600 0.016192925 1.176150062
[36] 0.468122347 -0.059358426 -1.743793216 0.262635813 -1.073839254
[41] -1.588208985 -0.789182405 -0.719290777 0.940141890 -0.211253161
[46] -0.953547686 -0.067411329 -0.251405982 -0.181192703 1.427439363
[51] -0.136715526 -0.641334604 0.831130367 0.461551965 0.208634499
[56] -0.288451526 -0.511928707 0.458678095 0.455855933 -0.181802673
[61] -0.844828181 -0.097168767 -0.303790060 -0.114031777 -0.571053974
[66] 0.025770336 0.221324900 -1.027041756 2.041718530 1.042677045
[71] -1.243468663 -0.478898219 0.537926737 -0.339452564 0.368620410
[76] -0.281394186 -2.591707150 -1.348113276 0.435348062 0.887934229
[81] -0.598414607 1.114365188 -0.015294565 0.274016514 0.519790398
[86] 1.665915797 1.319532811 1.118836567 -1.466612371 -0.517646170
[91] -0.003981158 -0.533724520 0.421331084 -0.120705553 1.150022564
[96] -0.004525386 -0.104000725 0.493418189 -0.761909967 -0.294615394
> colSums(tmp)
[1] -0.805416660 0.314322813 2.105664056 -0.259895558 -1.837251281
[6] -1.105485251 -0.590372133 -0.615779172 -1.581474410 1.121589059
[11] 0.853911975 0.263855874 0.945684242 -0.636176874 -2.414183010
[16] 0.267779609 1.007434427 0.081217662 -0.040938965 0.044530904
[21] 0.348337235 0.083071447 -0.975442967 1.990752251 -1.957068803
[26] -0.082993538 -1.359960473 -1.755345185 0.057727128 0.114366257
[31] -0.187241182 -1.388812783 -1.227208600 0.016192925 1.176150062
[36] 0.468122347 -0.059358426 -1.743793216 0.262635813 -1.073839254
[41] -1.588208985 -0.789182405 -0.719290777 0.940141890 -0.211253161
[46] -0.953547686 -0.067411329 -0.251405982 -0.181192703 1.427439363
[51] -0.136715526 -0.641334604 0.831130367 0.461551965 0.208634499
[56] -0.288451526 -0.511928707 0.458678095 0.455855933 -0.181802673
[61] -0.844828181 -0.097168767 -0.303790060 -0.114031777 -0.571053974
[66] 0.025770336 0.221324900 -1.027041756 2.041718530 1.042677045
[71] -1.243468663 -0.478898219 0.537926737 -0.339452564 0.368620410
[76] -0.281394186 -2.591707150 -1.348113276 0.435348062 0.887934229
[81] -0.598414607 1.114365188 -0.015294565 0.274016514 0.519790398
[86] 1.665915797 1.319532811 1.118836567 -1.466612371 -0.517646170
[91] -0.003981158 -0.533724520 0.421331084 -0.120705553 1.150022564
[96] -0.004525386 -0.104000725 0.493418189 -0.761909967 -0.294615394
> 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.805416660 0.314322813 2.105664056 -0.259895558 -1.837251281
[6] -1.105485251 -0.590372133 -0.615779172 -1.581474410 1.121589059
[11] 0.853911975 0.263855874 0.945684242 -0.636176874 -2.414183010
[16] 0.267779609 1.007434427 0.081217662 -0.040938965 0.044530904
[21] 0.348337235 0.083071447 -0.975442967 1.990752251 -1.957068803
[26] -0.082993538 -1.359960473 -1.755345185 0.057727128 0.114366257
[31] -0.187241182 -1.388812783 -1.227208600 0.016192925 1.176150062
[36] 0.468122347 -0.059358426 -1.743793216 0.262635813 -1.073839254
[41] -1.588208985 -0.789182405 -0.719290777 0.940141890 -0.211253161
[46] -0.953547686 -0.067411329 -0.251405982 -0.181192703 1.427439363
[51] -0.136715526 -0.641334604 0.831130367 0.461551965 0.208634499
[56] -0.288451526 -0.511928707 0.458678095 0.455855933 -0.181802673
[61] -0.844828181 -0.097168767 -0.303790060 -0.114031777 -0.571053974
[66] 0.025770336 0.221324900 -1.027041756 2.041718530 1.042677045
[71] -1.243468663 -0.478898219 0.537926737 -0.339452564 0.368620410
[76] -0.281394186 -2.591707150 -1.348113276 0.435348062 0.887934229
[81] -0.598414607 1.114365188 -0.015294565 0.274016514 0.519790398
[86] 1.665915797 1.319532811 1.118836567 -1.466612371 -0.517646170
[91] -0.003981158 -0.533724520 0.421331084 -0.120705553 1.150022564
[96] -0.004525386 -0.104000725 0.493418189 -0.761909967 -0.294615394
> colMin(tmp)
[1] -0.805416660 0.314322813 2.105664056 -0.259895558 -1.837251281
[6] -1.105485251 -0.590372133 -0.615779172 -1.581474410 1.121589059
[11] 0.853911975 0.263855874 0.945684242 -0.636176874 -2.414183010
[16] 0.267779609 1.007434427 0.081217662 -0.040938965 0.044530904
[21] 0.348337235 0.083071447 -0.975442967 1.990752251 -1.957068803
[26] -0.082993538 -1.359960473 -1.755345185 0.057727128 0.114366257
[31] -0.187241182 -1.388812783 -1.227208600 0.016192925 1.176150062
[36] 0.468122347 -0.059358426 -1.743793216 0.262635813 -1.073839254
[41] -1.588208985 -0.789182405 -0.719290777 0.940141890 -0.211253161
[46] -0.953547686 -0.067411329 -0.251405982 -0.181192703 1.427439363
[51] -0.136715526 -0.641334604 0.831130367 0.461551965 0.208634499
[56] -0.288451526 -0.511928707 0.458678095 0.455855933 -0.181802673
[61] -0.844828181 -0.097168767 -0.303790060 -0.114031777 -0.571053974
[66] 0.025770336 0.221324900 -1.027041756 2.041718530 1.042677045
[71] -1.243468663 -0.478898219 0.537926737 -0.339452564 0.368620410
[76] -0.281394186 -2.591707150 -1.348113276 0.435348062 0.887934229
[81] -0.598414607 1.114365188 -0.015294565 0.274016514 0.519790398
[86] 1.665915797 1.319532811 1.118836567 -1.466612371 -0.517646170
[91] -0.003981158 -0.533724520 0.421331084 -0.120705553 1.150022564
[96] -0.004525386 -0.104000725 0.493418189 -0.761909967 -0.294615394
> colMedians(tmp)
[1] -0.805416660 0.314322813 2.105664056 -0.259895558 -1.837251281
[6] -1.105485251 -0.590372133 -0.615779172 -1.581474410 1.121589059
[11] 0.853911975 0.263855874 0.945684242 -0.636176874 -2.414183010
[16] 0.267779609 1.007434427 0.081217662 -0.040938965 0.044530904
[21] 0.348337235 0.083071447 -0.975442967 1.990752251 -1.957068803
[26] -0.082993538 -1.359960473 -1.755345185 0.057727128 0.114366257
[31] -0.187241182 -1.388812783 -1.227208600 0.016192925 1.176150062
[36] 0.468122347 -0.059358426 -1.743793216 0.262635813 -1.073839254
[41] -1.588208985 -0.789182405 -0.719290777 0.940141890 -0.211253161
[46] -0.953547686 -0.067411329 -0.251405982 -0.181192703 1.427439363
[51] -0.136715526 -0.641334604 0.831130367 0.461551965 0.208634499
[56] -0.288451526 -0.511928707 0.458678095 0.455855933 -0.181802673
[61] -0.844828181 -0.097168767 -0.303790060 -0.114031777 -0.571053974
[66] 0.025770336 0.221324900 -1.027041756 2.041718530 1.042677045
[71] -1.243468663 -0.478898219 0.537926737 -0.339452564 0.368620410
[76] -0.281394186 -2.591707150 -1.348113276 0.435348062 0.887934229
[81] -0.598414607 1.114365188 -0.015294565 0.274016514 0.519790398
[86] 1.665915797 1.319532811 1.118836567 -1.466612371 -0.517646170
[91] -0.003981158 -0.533724520 0.421331084 -0.120705553 1.150022564
[96] -0.004525386 -0.104000725 0.493418189 -0.761909967 -0.294615394
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.8054167 0.3143228 2.105664 -0.2598956 -1.837251 -1.105485 -0.5903721
[2,] -0.8054167 0.3143228 2.105664 -0.2598956 -1.837251 -1.105485 -0.5903721
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.6157792 -1.581474 1.121589 0.853912 0.2638559 0.9456842 -0.6361769
[2,] -0.6157792 -1.581474 1.121589 0.853912 0.2638559 0.9456842 -0.6361769
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -2.414183 0.2677796 1.007434 0.08121766 -0.04093896 0.0445309 0.3483372
[2,] -2.414183 0.2677796 1.007434 0.08121766 -0.04093896 0.0445309 0.3483372
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.08307145 -0.975443 1.990752 -1.957069 -0.08299354 -1.35996 -1.755345
[2,] 0.08307145 -0.975443 1.990752 -1.957069 -0.08299354 -1.35996 -1.755345
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.05772713 0.1143663 -0.1872412 -1.388813 -1.227209 0.01619292 1.17615
[2,] 0.05772713 0.1143663 -0.1872412 -1.388813 -1.227209 0.01619292 1.17615
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.4681223 -0.05935843 -1.743793 0.2626358 -1.073839 -1.588209 -0.7891824
[2,] 0.4681223 -0.05935843 -1.743793 0.2626358 -1.073839 -1.588209 -0.7891824
[,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.7192908 0.9401419 -0.2112532 -0.9535477 -0.06741133 -0.251406
[2,] -0.7192908 0.9401419 -0.2112532 -0.9535477 -0.06741133 -0.251406
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.1811927 1.427439 -0.1367155 -0.6413346 0.8311304 0.461552 0.2086345
[2,] -0.1811927 1.427439 -0.1367155 -0.6413346 0.8311304 0.461552 0.2086345
[,56] [,57] [,58] [,59] [,60] [,61]
[1,] -0.2884515 -0.5119287 0.4586781 0.4558559 -0.1818027 -0.8448282
[2,] -0.2884515 -0.5119287 0.4586781 0.4558559 -0.1818027 -0.8448282
[,62] [,63] [,64] [,65] [,66] [,67] [,68]
[1,] -0.09716877 -0.3037901 -0.1140318 -0.571054 0.02577034 0.2213249 -1.027042
[2,] -0.09716877 -0.3037901 -0.1140318 -0.571054 0.02577034 0.2213249 -1.027042
[,69] [,70] [,71] [,72] [,73] [,74] [,75]
[1,] 2.041719 1.042677 -1.243469 -0.4788982 0.5379267 -0.3394526 0.3686204
[2,] 2.041719 1.042677 -1.243469 -0.4788982 0.5379267 -0.3394526 0.3686204
[,76] [,77] [,78] [,79] [,80] [,81] [,82]
[1,] -0.2813942 -2.591707 -1.348113 0.4353481 0.8879342 -0.5984146 1.114365
[2,] -0.2813942 -2.591707 -1.348113 0.4353481 0.8879342 -0.5984146 1.114365
[,83] [,84] [,85] [,86] [,87] [,88] [,89]
[1,] -0.01529456 0.2740165 0.5197904 1.665916 1.319533 1.118837 -1.466612
[2,] -0.01529456 0.2740165 0.5197904 1.665916 1.319533 1.118837 -1.466612
[,90] [,91] [,92] [,93] [,94] [,95]
[1,] -0.5176462 -0.003981158 -0.5337245 0.4213311 -0.1207056 1.150023
[2,] -0.5176462 -0.003981158 -0.5337245 0.4213311 -0.1207056 1.150023
[,96] [,97] [,98] [,99] [,100]
[1,] -0.004525386 -0.1040007 0.4934182 -0.76191 -0.2946154
[2,] -0.004525386 -0.1040007 0.4934182 -0.76191 -0.2946154
>
>
> Max(tmp2)
[1] 2.212244
> Min(tmp2)
[1] -3.038882
> mean(tmp2)
[1] -0.2085053
> Sum(tmp2)
[1] -20.85053
> Var(tmp2)
[1] 0.8473854
>
> rowMeans(tmp2)
[1] 0.28680339 -0.82786101 -0.89754979 0.17328133 -0.32111122 0.42000067
[7] 0.84428591 -0.18819856 -0.74023151 0.09925316 1.66834461 -0.29929245
[13] -0.39385789 -0.49397996 -1.63738230 1.86688440 -0.62448268 0.54977976
[19] 0.15171137 -0.11540237 -0.71563451 0.48395067 0.34302044 0.52006197
[25] 0.17576029 2.21224414 0.87775374 -0.97212989 -0.80884852 -0.25401866
[31] -1.03273946 -3.03888218 0.11272740 -0.12941049 0.35468694 -0.16366188
[37] 0.11733438 -0.78574112 -0.13554859 -0.53763195 1.31252948 -0.11470684
[43] -0.92138100 0.27916241 0.02855494 0.94589902 -0.93059226 0.40943146
[49] -0.85082330 -0.14037613 0.32441067 -1.58187600 -0.13603507 0.35451514
[55] -0.88740834 -0.22755997 -1.00629094 -0.06255121 0.01446449 -0.56479371
[61] 0.28927734 -0.57475975 -1.69777487 -0.32307260 1.24043965 -0.72793553
[67] 0.68743487 0.43853667 -1.04975556 -0.30456838 -0.35406858 -1.57276704
[73] 0.21152466 0.84388967 -0.32430198 -0.26478038 1.59645199 -0.35530100
[79] -1.92604822 0.81827591 -1.50155834 1.00453471 1.07186540 -0.38036403
[85] 1.71456167 -0.12957885 -0.12478343 -2.13304040 -0.56029186 -1.60294295
[91] -0.43930064 -1.35086032 -1.52555439 -0.16494425 -1.22216710 0.70989882
[97] -0.65202740 0.47733719 -1.71239151 -1.36848170
> rowSums(tmp2)
[1] 0.28680339 -0.82786101 -0.89754979 0.17328133 -0.32111122 0.42000067
[7] 0.84428591 -0.18819856 -0.74023151 0.09925316 1.66834461 -0.29929245
[13] -0.39385789 -0.49397996 -1.63738230 1.86688440 -0.62448268 0.54977976
[19] 0.15171137 -0.11540237 -0.71563451 0.48395067 0.34302044 0.52006197
[25] 0.17576029 2.21224414 0.87775374 -0.97212989 -0.80884852 -0.25401866
[31] -1.03273946 -3.03888218 0.11272740 -0.12941049 0.35468694 -0.16366188
[37] 0.11733438 -0.78574112 -0.13554859 -0.53763195 1.31252948 -0.11470684
[43] -0.92138100 0.27916241 0.02855494 0.94589902 -0.93059226 0.40943146
[49] -0.85082330 -0.14037613 0.32441067 -1.58187600 -0.13603507 0.35451514
[55] -0.88740834 -0.22755997 -1.00629094 -0.06255121 0.01446449 -0.56479371
[61] 0.28927734 -0.57475975 -1.69777487 -0.32307260 1.24043965 -0.72793553
[67] 0.68743487 0.43853667 -1.04975556 -0.30456838 -0.35406858 -1.57276704
[73] 0.21152466 0.84388967 -0.32430198 -0.26478038 1.59645199 -0.35530100
[79] -1.92604822 0.81827591 -1.50155834 1.00453471 1.07186540 -0.38036403
[85] 1.71456167 -0.12957885 -0.12478343 -2.13304040 -0.56029186 -1.60294295
[91] -0.43930064 -1.35086032 -1.52555439 -0.16494425 -1.22216710 0.70989882
[97] -0.65202740 0.47733719 -1.71239151 -1.36848170
> 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.28680339 -0.82786101 -0.89754979 0.17328133 -0.32111122 0.42000067
[7] 0.84428591 -0.18819856 -0.74023151 0.09925316 1.66834461 -0.29929245
[13] -0.39385789 -0.49397996 -1.63738230 1.86688440 -0.62448268 0.54977976
[19] 0.15171137 -0.11540237 -0.71563451 0.48395067 0.34302044 0.52006197
[25] 0.17576029 2.21224414 0.87775374 -0.97212989 -0.80884852 -0.25401866
[31] -1.03273946 -3.03888218 0.11272740 -0.12941049 0.35468694 -0.16366188
[37] 0.11733438 -0.78574112 -0.13554859 -0.53763195 1.31252948 -0.11470684
[43] -0.92138100 0.27916241 0.02855494 0.94589902 -0.93059226 0.40943146
[49] -0.85082330 -0.14037613 0.32441067 -1.58187600 -0.13603507 0.35451514
[55] -0.88740834 -0.22755997 -1.00629094 -0.06255121 0.01446449 -0.56479371
[61] 0.28927734 -0.57475975 -1.69777487 -0.32307260 1.24043965 -0.72793553
[67] 0.68743487 0.43853667 -1.04975556 -0.30456838 -0.35406858 -1.57276704
[73] 0.21152466 0.84388967 -0.32430198 -0.26478038 1.59645199 -0.35530100
[79] -1.92604822 0.81827591 -1.50155834 1.00453471 1.07186540 -0.38036403
[85] 1.71456167 -0.12957885 -0.12478343 -2.13304040 -0.56029186 -1.60294295
[91] -0.43930064 -1.35086032 -1.52555439 -0.16494425 -1.22216710 0.70989882
[97] -0.65202740 0.47733719 -1.71239151 -1.36848170
> rowMin(tmp2)
[1] 0.28680339 -0.82786101 -0.89754979 0.17328133 -0.32111122 0.42000067
[7] 0.84428591 -0.18819856 -0.74023151 0.09925316 1.66834461 -0.29929245
[13] -0.39385789 -0.49397996 -1.63738230 1.86688440 -0.62448268 0.54977976
[19] 0.15171137 -0.11540237 -0.71563451 0.48395067 0.34302044 0.52006197
[25] 0.17576029 2.21224414 0.87775374 -0.97212989 -0.80884852 -0.25401866
[31] -1.03273946 -3.03888218 0.11272740 -0.12941049 0.35468694 -0.16366188
[37] 0.11733438 -0.78574112 -0.13554859 -0.53763195 1.31252948 -0.11470684
[43] -0.92138100 0.27916241 0.02855494 0.94589902 -0.93059226 0.40943146
[49] -0.85082330 -0.14037613 0.32441067 -1.58187600 -0.13603507 0.35451514
[55] -0.88740834 -0.22755997 -1.00629094 -0.06255121 0.01446449 -0.56479371
[61] 0.28927734 -0.57475975 -1.69777487 -0.32307260 1.24043965 -0.72793553
[67] 0.68743487 0.43853667 -1.04975556 -0.30456838 -0.35406858 -1.57276704
[73] 0.21152466 0.84388967 -0.32430198 -0.26478038 1.59645199 -0.35530100
[79] -1.92604822 0.81827591 -1.50155834 1.00453471 1.07186540 -0.38036403
[85] 1.71456167 -0.12957885 -0.12478343 -2.13304040 -0.56029186 -1.60294295
[91] -0.43930064 -1.35086032 -1.52555439 -0.16494425 -1.22216710 0.70989882
[97] -0.65202740 0.47733719 -1.71239151 -1.36848170
>
> colMeans(tmp2)
[1] -0.2085053
> colSums(tmp2)
[1] -20.85053
> colVars(tmp2)
[1] 0.8473854
> colSd(tmp2)
[1] 0.9205354
> colMax(tmp2)
[1] 2.212244
> colMin(tmp2)
[1] -3.038882
> colMedians(tmp2)
[1] -0.1765714
> colRanges(tmp2)
[,1]
[1,] -3.038882
[2,] 2.212244
>
> 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.7194114 -5.1979748 -5.9220190 0.3772284 -3.0559710 1.8529162
[7] 0.1411246 5.3849506 -7.4983163 2.4095236
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1346139
[2,] -0.5481555
[3,] -0.0463338
[4,] 0.3883519
[5,] 1.0615490
>
> rowApply(tmp,sum)
[1] -1.7445207 -5.4592131 -0.1655705 0.2571726 -1.9765520 -2.6319220
[7] 3.5107473 -5.8856828 2.3075163 -0.4399243
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 4 3 3 6 3 3 9 4 10
[2,] 2 3 5 5 1 2 8 4 9 4
[3,] 6 8 2 7 4 9 1 1 1 2
[4,] 8 1 10 9 5 4 6 3 10 3
[5,] 1 2 9 2 10 10 9 2 2 7
[6,] 7 5 1 10 9 6 4 7 6 8
[7,] 5 10 6 4 3 7 5 5 5 9
[8,] 10 7 7 8 7 5 7 10 7 6
[9,] 4 6 4 1 2 8 2 8 3 1
[10,] 3 9 8 6 8 1 10 6 8 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.86891309 1.10528720 -1.77938328 -0.04372203 0.89269122 2.82429071
[7] 2.73978106 2.94514421 3.49713505 -3.07649254 2.45067759 0.20807433
[13] 4.57148037 -0.23676800 -3.47105508 -0.85197961 2.34903849 -0.53427034
[19] 2.89870659 2.33403261
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4592733
[2,] -1.0937482
[3,] -0.6119271
[4,] -0.3446364
[5,] 0.6406720
>
> rowApply(tmp,sum)
[1] 6.037210 8.327465 1.692184 -2.055642 1.952539
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 8 14 6
[2,] 5 7 19 16 7
[3,] 2 14 6 4 15
[4,] 13 6 11 9 10
[5,] 14 1 20 6 17
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.4592733 -0.3495581 -1.4022543 0.64673075 0.6786897 2.0938356
[2,] -1.0937482 -0.6131037 1.1213102 -0.68247315 -1.6109826 0.6842922
[3,] -0.6119271 1.5227404 -0.7372518 0.02075592 1.7211244 -0.1911256
[4,] 0.6406720 0.8635946 -1.5018690 0.04438202 -0.7704799 0.9629368
[5,] -0.3446364 -0.3183859 0.7406817 -0.07311757 0.8743397 -0.7256483
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.1793070 0.309225041 1.1371791 1.19048568 -0.1649198 0.05660173
[2,] 2.5541490 1.631526960 0.7705872 -1.09038851 1.4981376 0.63264916
[3,] 1.0151824 0.795146320 -0.7845075 -1.20924008 -1.0162152 1.32972871
[4,] -0.5252781 0.204776269 1.6237201 -1.88732873 1.2050332 -1.82597634
[5,] -0.4835792 0.004469624 0.7501562 -0.08002091 0.9286418 0.01507106
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.87486458 -0.64516661 0.4021387 -0.01448796 0.82344884 -0.4133882
[2,] 1.50094227 0.86328499 -1.1743598 -1.03947720 1.36904481 1.6228828
[3,] 1.09001285 0.04839121 -1.0883863 -0.88364667 -0.08285937 -0.6777118
[4,] 0.16202198 -1.75507873 -0.7287155 0.69492438 0.97634322 0.3935307
[5,] -0.05636131 1.25180113 -0.8817323 0.39070783 -0.73693900 -1.4595838
[,19] [,20]
[1,] 0.9372454 0.1565057
[2,] 0.3902797 0.9929112
[3,] 1.3071369 0.1248367
[4,] 0.5039362 -1.3367872
[5,] -0.2398916 2.3965662
>
>
> 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 : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.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.6033628 -2.0964 -0.3327835 -2.753713 -1.615168 -1.248889 0.3944755
col8 col9 col10 col11 col12 col13 col14
row1 -1.047287 -0.4049697 1.21423 -0.0400328 -0.7434319 0.5601546 -0.4576627
col15 col16 col17 col18 col19 col20
row1 -0.3555779 0.8827968 1.883197 0.2848212 -0.1708639 -1.384409
> tmp[,"col10"]
col10
row1 1.2142302
row2 0.5300948
row3 -0.7385643
row4 0.6562901
row5 0.8405820
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6033628 -2.0964001 -0.3327835 -2.753713 -1.6151679 -1.2488891 0.3944755
row5 0.1747880 -0.7488888 2.1594851 -1.459485 0.5613954 0.6962786 0.8004379
col8 col9 col10 col11 col12 col13 col14
row1 -1.047287 -0.4049697 1.214230 -0.0400328 -0.7434319 0.5601546 -0.4576627
row5 -1.432687 -0.4588446 0.840582 1.8507607 -0.8212046 1.1179615 0.4743365
col15 col16 col17 col18 col19 col20
row1 -0.3555779 0.8827968 1.8831969 0.2848212 -0.1708639 -1.3844090
row5 0.2199879 1.0685942 -0.9077861 -1.5092056 -0.8610032 -0.1559741
> tmp[,c("col6","col20")]
col6 col20
row1 -1.2488891 -1.3844090
row2 -0.8842303 -1.7664872
row3 -1.5415444 1.5600336
row4 -1.7944386 0.4945409
row5 0.6962786 -0.1559741
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.2488891 -1.3844090
row5 0.6962786 -0.1559741
>
>
>
>
> 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.93172 49.31237 50.14372 50.16999 48.09705 105.5202 49.44956 49.83765
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.40841 50.43921 48.90903 49.89494 50.54196 50.67841 49.04865 49.91108
col17 col18 col19 col20
row1 49.78675 49.48189 49.73965 105.9213
> tmp[,"col10"]
col10
row1 50.43921
row2 30.37824
row3 33.43155
row4 30.03725
row5 50.70689
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.93172 49.31237 50.14372 50.16999 48.09705 105.5202 49.44956 49.83765
row5 50.66257 50.16491 51.64945 49.43076 51.57474 106.6109 51.29834 49.96217
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.40841 50.43921 48.90903 49.89494 50.54196 50.67841 49.04865 49.91108
row5 51.69739 50.70689 49.91937 48.74546 50.41792 51.26160 50.11305 49.62801
col17 col18 col19 col20
row1 49.78675 49.48189 49.73965 105.9213
row5 50.48394 48.21363 50.24891 105.4989
> tmp[,c("col6","col20")]
col6 col20
row1 105.52018 105.92127
row2 74.57113 75.48858
row3 74.49140 74.88287
row4 75.62500 75.76892
row5 106.61086 105.49887
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.5202 105.9213
row5 106.6109 105.4989
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.5202 105.9213
row5 106.6109 105.4989
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.4731728
[2,] 1.3229725
[3,] -0.7373254
[4,] 2.7928588
[5,] -1.0125190
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.01077565 0.69551115
[2,] 0.13118798 -0.65232561
[3,] -0.45761417 1.91216779
[4,] -1.17639997 0.06522558
[5,] -1.52285123 1.53594914
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.8144690238 -0.08629219
[2,] 0.2342626524 0.70017265
[3,] 0.3051894736 -1.56511295
[4,] 0.0005997384 -1.12118682
[5,] -0.0059640018 -0.22970000
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.814469
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.8144690
[2,] 0.2342627
>
>
>
> 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]
row3 -0.5426587 -0.1757126 -0.08823151 -0.9973085 1.100119 -0.4206578
row1 0.3116364 0.6604620 -1.06198814 -2.0444870 1.488599 -0.9546495
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.85634979 0.5996040 1.006626 1.469782 0.6052268 0.2104598
row1 0.02851601 -0.4035385 -1.512503 -1.696056 -0.1895686 -2.3666888
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -1.8827336 -0.5164105 -0.3017866 2.1879505 0.05521587 -0.2634649
row1 -0.7294558 0.5649714 -0.5299284 0.1365756 -1.28459219 -1.7061495
[,19] [,20]
row3 1.117329 1.033147
row1 -0.397969 -1.061478
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.4388298 1.704978 0.4104436 -1.017799 -0.153658 -0.7685997 -1.816368
[,8] [,9] [,10]
row2 0.7610947 0.1929528 -1.014114
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.1890154 -0.7927646 0.6709654 1.078044 0.7020978 1.179204 -0.03330474
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.03420509 0.795486 -1.590455 -0.2798791 -0.06206764 -0.8118904 -2.41034
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.479139 0.8208554 -0.4461979 -1.476461 1.58292 0.4122646
>
>
> 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: 0x600003ee0120>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f146cfd3b"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f7f6536f6"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f4dfb91d1"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f3f225856"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f67d5967b"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f778a9a7e"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f2ca50382"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f58962b4"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f7eaf1a42"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f19e52408"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f12a09680"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f6cf8b70d"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f3cb9ee5f"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f52d0be1e"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1629f671ce0c"
>
>
> ### 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: 0x600003e6c000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003e6c000>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003e6c000>
> rowMedians(tmp)
[1] -0.395047134 0.231785848 0.235964389 -0.245512821 0.074864585
[6] 0.102091476 0.174224452 0.303488749 -0.201227701 -0.184102000
[11] -0.305237541 0.144328257 -0.027314556 0.556051847 -0.453370809
[16] -0.352299356 0.093777106 0.251693911 0.148935795 -0.194352516
[21] -0.091912295 -0.732546671 0.070384375 -0.351871103 -0.525341897
[26] -0.216092541 0.461904748 -0.297288131 0.202613137 -0.557127430
[31] -0.101167896 -0.182118628 0.282066560 -0.300164627 0.157318103
[36] -0.106162056 0.131949572 0.211091112 -0.007414671 0.545836239
[41] 0.041293495 -0.249439679 0.036758720 0.299568326 0.371474807
[46] 0.298725278 0.554185406 0.988308928 -0.212180972 -0.218917304
[51] -0.039003696 -0.279225413 -0.345129375 -0.086540433 -0.328140051
[56] 0.240812718 -0.110571581 -0.042359039 0.333744466 0.101509188
[61] 0.292271846 0.723427706 0.324410890 -0.201017933 0.500548368
[66] -0.313839228 0.534723540 -0.153510841 -0.116688533 0.292783809
[71] 0.079893931 -0.030211714 -0.434240671 0.260528682 -0.104003429
[76] -0.016496669 -0.618091514 0.026778190 -0.419948666 0.252316384
[81] 0.159179051 0.208887261 0.325173184 -0.282022299 0.445771760
[86] 0.224618307 0.139915811 0.437112292 -0.723531718 0.499905093
[91] 0.171646413 -0.464427600 -0.705744508 0.714284326 -0.047671843
[96] -0.204182256 0.110318486 0.511927452 -0.407803587 0.232055550
[101] 0.519171010 0.302207787 -0.395554944 0.382618106 -0.028546388
[106] -0.020302946 -0.247552201 -0.128192220 0.321657249 -0.055613288
[111] 0.176593384 0.450000284 -0.190534544 -0.014032870 0.338929880
[116] -0.453717506 0.422192027 0.178047303 0.262156249 -0.143716237
[121] 0.445294196 -0.157416028 -0.190115172 0.103763633 0.315975457
[126] -0.352412345 0.257424428 -0.167845663 -0.279956402 -0.005114030
[131] -0.013432341 -0.225296861 0.267828801 -0.041370857 0.214017088
[136] -0.242701703 -0.157097151 0.358235088 0.423980073 0.679583973
[141] -0.002321631 -0.273447183 -0.373020301 0.213980216 0.226640340
[146] 0.026736524 -0.487964748 -0.103599916 -0.247276913 -0.258084201
[151] 0.320859324 -0.365677580 0.181733779 -0.104900513 0.107802949
[156] 0.127729041 0.487641644 0.182668472 0.367094914 -0.079510177
[161] 0.075869947 -0.125053084 0.262429477 0.379926931 -0.014599349
[166] 0.283728940 -0.423441037 0.366378905 0.151542065 -0.596745697
[171] -0.563028306 0.014339050 -0.313577089 0.147797905 -0.599117914
[176] 0.238416515 0.268175031 0.085803926 0.430529948 -0.500441669
[181] 0.097293754 0.399722096 0.610979198 -0.327543215 -0.566966640
[186] -0.231778236 -0.231360313 -0.170934855 -0.155845666 -0.317096682
[191] 0.272826002 -0.006749385 0.188365657 0.018890694 0.013508931
[196] 0.063828946 -0.573649063 -0.481112275 0.186414367 -0.136010201
[201] 0.643044170 -0.175987904 0.073012566 0.006426115 0.063734939
[206] 0.635577949 0.296796807 -0.336673702 0.200344468 -0.008656412
[211] 0.441223520 -0.297862297 0.158206876 -0.108386711 0.031168736
[216] -0.476369084 0.104451804 0.245144665 0.415284715 -0.710366304
[221] 0.190931475 0.227368361 -0.183614734 0.387182218 0.224167204
[226] 0.054748988 -0.248701095 -0.296848098 0.346114107 0.244745691
>
> proc.time()
user system elapsed
2.571 14.592 17.612
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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: 0x600001180000>
> .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: 0x600001180000>
> .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: 0x600001180000>
> .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: 0x600001180000>
> 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: 0x6000011a8120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8120>
> .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: 0x6000011a8120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8120>
> .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: 0x6000011a8120>
> 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: 0x6000011a82a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a82a0>
> .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: 0x6000011a82a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000011a82a0>
> .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: 0x6000011a82a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000011a82a0>
> .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: 0x6000011a82a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000011a82a0>
> .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: 0x6000011a82a0>
> 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: 0x6000011a8480>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000011a8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8480>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile167e035ab22a6" "BufferedMatrixFile167e0687adeb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile167e035ab22a6" "BufferedMatrixFile167e0687adeb"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8720>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000011a8720>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000011a8720>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000011a8720>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000011a8720>
> .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: 0x6000011a8900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000011a8900>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000011a8900>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000011a8900>
> 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: 0x6000011d00c0>
> .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: 0x6000011d00c0>
> rm(P)
>
> proc.time()
user system elapsed
0.315 0.136 0.444
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
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.317 0.086 0.394