| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-11-22 11:38 -0500 (Sat, 22 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4829 |
| lconway | macOS 12.7.6 Monterey | x86_64 | R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" | 4603 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4567 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 252/2327 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-11-21 19:52:38 -0500 (Fri, 21 Nov 2025) |
| EndedAt: 2025-11-21 19:53:31 -0500 (Fri, 21 Nov 2025) |
| EllapsedTime: 53.1 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-21 r88958)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
* used SDK: ‘MacOSX11.3.1.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.320 0.142 0.479
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481268 25.8 1058102 56.6 NA 633897 33.9
Vcells 891509 6.9 8388608 64.0 98304 2110436 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 19:53:05 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Nov 21 19:53:05 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: 0x600000564180>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 19:53:09 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Nov 21 19:53:11 2025"
>
> ColMode(tmp2)
<pointer: 0x600000564180>
>
>
>
> ### 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,] 1.004911e+02 1.5177829 -0.57401576 -1.2935634
[2,] 8.452885e-03 -0.9029238 -0.68492310 -0.9519212
[3,] 1.785693e+00 0.6622697 -0.58152193 -0.3586944
[4,] 7.755745e-01 0.2333498 0.02555371 -1.1225919
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 1.004911e+02 1.5177829 0.57401576 1.2935634
[2,] 8.452885e-03 0.9029238 0.68492310 0.9519212
[3,] 1.785693e+00 0.6622697 0.58152193 0.3586944
[4,] 7.755745e-01 0.2333498 0.02555371 1.1225919
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.02452630 1.2319833 0.7576383 1.1373493
[2,] 0.09193957 0.9502230 0.8276008 0.9756645
[3,] 1.33629817 0.8137995 0.7625759 0.5989110
[4,] 0.88066710 0.4830629 0.1598553 1.0595244
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.73639 38.83762 33.15040 37.66706
[2,] 25.92785 35.40515 33.96093 35.70857
[3,] 40.14867 33.80026 33.20728 31.34780
[4,] 34.58225 30.06398 26.62411 36.71784
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000524000>
> exp(tmp5)
<pointer: 0x600000524000>
> log(tmp5,2)
<pointer: 0x600000524000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.8407
> Min(tmp5)
[1] 53.37861
> mean(tmp5)
[1] 72.01802
> Sum(tmp5)
[1] 14403.6
> Var(tmp5)
[1] 867.5713
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.50863 69.45037 70.01758 68.58428 70.57348 69.61335 70.70882 71.70475
[9] 70.72872 68.29022
> rowSums(tmp5)
[1] 1810.173 1389.007 1400.352 1371.686 1411.470 1392.267 1414.176 1434.095
[9] 1414.574 1365.804
> rowVars(tmp5)
[1] 8028.84497 77.36908 100.19841 58.27996 69.82114 78.34511
[7] 96.81598 59.70011 49.31611 57.94799
> rowSd(tmp5)
[1] 89.603822 8.795970 10.009916 7.634131 8.355905 8.851277 9.839511
[8] 7.726585 7.022543 7.612358
> rowMax(tmp5)
[1] 469.84072 87.46379 89.31122 89.38954 81.90798 83.30474 87.29168
[8] 90.55845 86.91914 82.27711
> rowMin(tmp5)
[1] 56.11224 53.96542 53.37861 55.41459 55.99092 55.39113 54.60503 61.02950
[9] 59.15378 54.97708
>
> colMeans(tmp5)
[1] 111.38275 68.61527 66.05073 72.41411 74.16319 70.11238 67.48438
[8] 68.28176 68.87234 63.96550 73.88566 71.15024 64.44552 69.05992
[15] 70.60206 70.20225 74.54615 73.14964 73.09102 68.88554
> colSums(tmp5)
[1] 1113.8275 686.1527 660.5073 724.1411 741.6319 701.1238 674.8438
[8] 682.8176 688.7234 639.6550 738.8566 711.5024 644.4552 690.5992
[15] 706.0206 702.0225 745.4615 731.4964 730.9102 688.8554
> colVars(tmp5)
[1] 15942.83981 70.86813 60.35637 105.35493 66.09482 55.19468
[7] 81.00162 26.95187 71.49738 42.61279 24.49995 71.13558
[13] 54.12514 68.60972 60.13129 108.66935 54.82398 31.36210
[19] 59.16262 118.02593
> colSd(tmp5)
[1] 126.264959 8.418321 7.768936 10.264255 8.129872 7.429312
[7] 9.000090 5.191519 8.455612 6.527847 4.949742 8.434191
[13] 7.356979 8.283099 7.754437 10.424459 7.404322 5.600187
[19] 7.691724 10.863974
> colMax(tmp5)
[1] 469.84072 80.83541 79.19435 87.29168 89.31122 81.92649 81.90798
[8] 74.51505 82.06467 73.39422 80.53661 82.30772 75.80320 80.85412
[15] 87.46379 84.34176 89.38954 84.18374 90.55845 86.73647
> colMin(tmp5)
[1] 53.96542 55.29100 55.41459 56.05656 62.83333 59.05591 57.33745 58.96300
[9] 55.83805 54.72194 66.78099 60.36357 53.37861 56.11224 62.14496 54.60503
[17] 63.71014 65.64396 64.47502 53.99335
>
>
> ### 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.50863 69.45037 70.01758 68.58428 70.57348 69.61335 70.70882 71.70475
[9] 70.72872 NA
> rowSums(tmp5)
[1] 1810.173 1389.007 1400.352 1371.686 1411.470 1392.267 1414.176 1434.095
[9] 1414.574 NA
> rowVars(tmp5)
[1] 8028.84497 77.36908 100.19841 58.27996 69.82114 78.34511
[7] 96.81598 59.70011 49.31611 59.47252
> rowSd(tmp5)
[1] 89.603822 8.795970 10.009916 7.634131 8.355905 8.851277 9.839511
[8] 7.726585 7.022543 7.711843
> rowMax(tmp5)
[1] 469.84072 87.46379 89.31122 89.38954 81.90798 83.30474 87.29168
[8] 90.55845 86.91914 NA
> rowMin(tmp5)
[1] 56.11224 53.96542 53.37861 55.41459 55.99092 55.39113 54.60503 61.02950
[9] 59.15378 NA
>
> colMeans(tmp5)
[1] 111.38275 68.61527 66.05073 72.41411 74.16319 70.11238 67.48438
[8] 68.28176 68.87234 63.96550 73.88566 71.15024 64.44552 69.05992
[15] 70.60206 NA 74.54615 73.14964 73.09102 68.88554
> colSums(tmp5)
[1] 1113.8275 686.1527 660.5073 724.1411 741.6319 701.1238 674.8438
[8] 682.8176 688.7234 639.6550 738.8566 711.5024 644.4552 690.5992
[15] 706.0206 NA 745.4615 731.4964 730.9102 688.8554
> colVars(tmp5)
[1] 15942.83981 70.86813 60.35637 105.35493 66.09482 55.19468
[7] 81.00162 26.95187 71.49738 42.61279 24.49995 71.13558
[13] 54.12514 68.60972 60.13129 NA 54.82398 31.36210
[19] 59.16262 118.02593
> colSd(tmp5)
[1] 126.264959 8.418321 7.768936 10.264255 8.129872 7.429312
[7] 9.000090 5.191519 8.455612 6.527847 4.949742 8.434191
[13] 7.356979 8.283099 7.754437 NA 7.404322 5.600187
[19] 7.691724 10.863974
> colMax(tmp5)
[1] 469.84072 80.83541 79.19435 87.29168 89.31122 81.92649 81.90798
[8] 74.51505 82.06467 73.39422 80.53661 82.30772 75.80320 80.85412
[15] 87.46379 NA 89.38954 84.18374 90.55845 86.73647
> colMin(tmp5)
[1] 53.96542 55.29100 55.41459 56.05656 62.83333 59.05591 57.33745 58.96300
[9] 55.83805 54.72194 66.78099 60.36357 53.37861 56.11224 62.14496 NA
[17] 63.71014 65.64396 64.47502 53.99335
>
> Max(tmp5,na.rm=TRUE)
[1] 469.8407
> Min(tmp5,na.rm=TRUE)
[1] 53.37861
> mean(tmp5,na.rm=TRUE)
[1] 72.0097
> Sum(tmp5,na.rm=TRUE)
[1] 14329.93
> Var(tmp5,na.rm=TRUE)
[1] 871.9391
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.50863 69.45037 70.01758 68.58428 70.57348 69.61335 70.70882 71.70475
[9] 70.72872 68.00688
> rowSums(tmp5,na.rm=TRUE)
[1] 1810.173 1389.007 1400.352 1371.686 1411.470 1392.267 1414.176 1434.095
[9] 1414.574 1292.131
> rowVars(tmp5,na.rm=TRUE)
[1] 8028.84497 77.36908 100.19841 58.27996 69.82114 78.34511
[7] 96.81598 59.70011 49.31611 59.47252
> rowSd(tmp5,na.rm=TRUE)
[1] 89.603822 8.795970 10.009916 7.634131 8.355905 8.851277 9.839511
[8] 7.726585 7.022543 7.711843
> rowMax(tmp5,na.rm=TRUE)
[1] 469.84072 87.46379 89.31122 89.38954 81.90798 83.30474 87.29168
[8] 90.55845 86.91914 82.27711
> rowMin(tmp5,na.rm=TRUE)
[1] 56.11224 53.96542 53.37861 55.41459 55.99092 55.39113 54.60503 61.02950
[9] 59.15378 54.97708
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.38275 68.61527 66.05073 72.41411 74.16319 70.11238 67.48438
[8] 68.28176 68.87234 63.96550 73.88566 71.15024 64.44552 69.05992
[15] 70.60206 69.81654 74.54615 73.14964 73.09102 68.88554
> colSums(tmp5,na.rm=TRUE)
[1] 1113.8275 686.1527 660.5073 724.1411 741.6319 701.1238 674.8438
[8] 682.8176 688.7234 639.6550 738.8566 711.5024 644.4552 690.5992
[15] 706.0206 628.3489 745.4615 731.4964 730.9102 688.8554
> colVars(tmp5,na.rm=TRUE)
[1] 15942.83981 70.86813 60.35637 105.35493 66.09482 55.19468
[7] 81.00162 26.95187 71.49738 42.61279 24.49995 71.13558
[13] 54.12514 68.60972 60.13129 120.57935 54.82398 31.36210
[19] 59.16262 118.02593
> colSd(tmp5,na.rm=TRUE)
[1] 126.264959 8.418321 7.768936 10.264255 8.129872 7.429312
[7] 9.000090 5.191519 8.455612 6.527847 4.949742 8.434191
[13] 7.356979 8.283099 7.754437 10.980863 7.404322 5.600187
[19] 7.691724 10.863974
> colMax(tmp5,na.rm=TRUE)
[1] 469.84072 80.83541 79.19435 87.29168 89.31122 81.92649 81.90798
[8] 74.51505 82.06467 73.39422 80.53661 82.30772 75.80320 80.85412
[15] 87.46379 84.34176 89.38954 84.18374 90.55845 86.73647
> colMin(tmp5,na.rm=TRUE)
[1] 53.96542 55.29100 55.41459 56.05656 62.83333 59.05591 57.33745 58.96300
[9] 55.83805 54.72194 66.78099 60.36357 53.37861 56.11224 62.14496 54.60503
[17] 63.71014 65.64396 64.47502 53.99335
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.50863 69.45037 70.01758 68.58428 70.57348 69.61335 70.70882 71.70475
[9] 70.72872 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1810.173 1389.007 1400.352 1371.686 1411.470 1392.267 1414.176 1434.095
[9] 1414.574 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 8028.84497 77.36908 100.19841 58.27996 69.82114 78.34511
[7] 96.81598 59.70011 49.31611 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 89.603822 8.795970 10.009916 7.634131 8.355905 8.851277 9.839511
[8] 7.726585 7.022543 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 469.84072 87.46379 89.31122 89.38954 81.90798 83.30474 87.29168
[8] 90.55845 86.91914 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 56.11224 53.96542 53.37861 55.41459 55.99092 55.39113 54.60503 61.02950
[9] 59.15378 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.61671 69.48844 66.37098 73.62100 75.42207 70.79558 67.43761
[8] 68.86380 69.25978 62.93104 73.92551 72.34875 64.73429 69.02428
[15] 70.38547 NaN 74.07188 72.65494 72.44483 70.43093
> colSums(tmp5,na.rm=TRUE)
[1] 1031.5504 625.3960 597.3388 662.5890 678.7986 637.1602 606.9384
[8] 619.7742 623.3380 566.3794 665.3296 651.1388 582.6086 621.2185
[15] 633.4692 0.0000 666.6469 653.8944 652.0035 633.8783
> colVars(tmp5,na.rm=TRUE)
[1] 17818.03671 71.14937 66.74718 102.13783 56.52809 56.84295
[7] 91.10221 26.50959 78.74580 35.90066 27.54458 63.86749
[13] 59.95264 77.17165 67.11994 NA 59.14649 32.52914
[19] 61.86046 105.91177
> colSd(tmp5,na.rm=TRUE)
[1] 133.484219 8.435008 8.169895 10.106326 7.518516 7.539426
[7] 9.544748 5.148746 8.873883 5.991716 5.248293 7.991714
[13] 7.742909 8.784740 8.192676 NA 7.690675 5.703432
[19] 7.865142 10.291344
> colMax(tmp5,na.rm=TRUE)
[1] 469.84072 80.83541 79.19435 87.29168 89.31122 81.92649 81.90798
[8] 74.51505 82.06467 73.39422 80.53661 82.30772 75.80320 80.85412
[15] 87.46379 -Inf 89.38954 84.18374 90.55845 86.73647
> colMin(tmp5,na.rm=TRUE)
[1] 53.96542 55.29100 55.41459 56.05656 67.26267 59.05591 57.33745 58.96300
[9] 55.83805 54.72194 66.78099 61.02950 53.37861 56.11224 62.14496 Inf
[17] 63.71014 65.64396 64.47502 53.99335
>
>
>
>
> 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] 158.9123 251.9005 254.9639 289.2532 192.1531 220.2688 251.6583 207.2240
[9] 129.4534 183.4509
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 158.9123 251.9005 254.9639 289.2532 192.1531 220.2688 251.6583 207.2240
[9] 129.4534 183.4509
>
>
>
> 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] -8.526513e-14 8.526513e-14 5.684342e-14 8.526513e-14 0.000000e+00
[6] 8.526513e-14 -4.263256e-14 0.000000e+00 8.526513e-14 0.000000e+00
[11] 8.526513e-14 -1.136868e-13 1.136868e-13 2.842171e-14 0.000000e+00
[16] 2.842171e-14 1.136868e-13 5.684342e-14 1.136868e-13 -7.105427e-15
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
3 1
3 13
3 20
8 17
6 12
3 2
9 11
3 10
8 11
8 4
7 18
5 4
2 14
4 2
1 5
5 11
1 16
2 1
8 6
2 1
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.86998
> Min(tmp)
[1] -2.537715
> mean(tmp)
[1] -0.08752544
> Sum(tmp)
[1] -8.752544
> Var(tmp)
[1] 1.257494
>
> rowMeans(tmp)
[1] -0.08752544
> rowSums(tmp)
[1] -8.752544
> rowVars(tmp)
[1] 1.257494
> rowSd(tmp)
[1] 1.121381
> rowMax(tmp)
[1] 2.86998
> rowMin(tmp)
[1] -2.537715
>
> colMeans(tmp)
[1] 0.061008215 -0.309738066 -0.911656865 -0.727595589 -0.010508252
[6] 0.878722621 -2.033393827 0.004552393 -0.504984213 1.276035117
[11] -1.517587679 -1.056259671 -0.733781033 -1.351337238 -0.023608110
[16] 1.656402792 0.292845223 0.479777881 0.697078727 0.983536282
[21] -1.219481048 1.705511041 -1.617917065 -0.101641197 0.856881385
[26] -0.018081289 -0.556935013 -0.501822979 0.914381185 -1.019067382
[31] -0.559775096 -0.675456895 -1.407880665 -0.723854581 1.351500401
[36] 1.896049035 1.929054588 1.244896848 1.953291458 -0.014264711
[41] 0.121525177 -1.952890293 0.701444039 0.207196513 0.158001560
[46] 0.138972257 -1.076510305 1.809829403 -0.562184215 -2.537715254
[51] 0.669224397 0.015370724 1.320027407 -0.736431250 -0.179437909
[56] -1.891064274 -0.314102035 0.066317450 -1.905362828 0.003257189
[61] 0.918886704 0.606020422 1.434640187 -1.110144480 -1.725424847
[66] 1.029124159 -0.628000387 -1.158823921 -0.338013959 2.869980050
[71] -1.554700511 -2.068220434 -1.151213128 -0.061121949 -1.509932518
[76] -1.277043279 -1.652007259 1.937133265 1.729874376 0.903688744
[81] 0.351118684 -0.700192536 -0.717916433 -0.483694773 1.761875160
[86] 1.436517428 -0.538413065 0.382136712 0.988099262 0.051769978
[91] -0.992602066 -0.390010931 -0.186667098 -0.447862282 0.569867694
[96] -0.955126428 0.159752051 -0.395755316 0.582617654 -1.063122984
> colSums(tmp)
[1] 0.061008215 -0.309738066 -0.911656865 -0.727595589 -0.010508252
[6] 0.878722621 -2.033393827 0.004552393 -0.504984213 1.276035117
[11] -1.517587679 -1.056259671 -0.733781033 -1.351337238 -0.023608110
[16] 1.656402792 0.292845223 0.479777881 0.697078727 0.983536282
[21] -1.219481048 1.705511041 -1.617917065 -0.101641197 0.856881385
[26] -0.018081289 -0.556935013 -0.501822979 0.914381185 -1.019067382
[31] -0.559775096 -0.675456895 -1.407880665 -0.723854581 1.351500401
[36] 1.896049035 1.929054588 1.244896848 1.953291458 -0.014264711
[41] 0.121525177 -1.952890293 0.701444039 0.207196513 0.158001560
[46] 0.138972257 -1.076510305 1.809829403 -0.562184215 -2.537715254
[51] 0.669224397 0.015370724 1.320027407 -0.736431250 -0.179437909
[56] -1.891064274 -0.314102035 0.066317450 -1.905362828 0.003257189
[61] 0.918886704 0.606020422 1.434640187 -1.110144480 -1.725424847
[66] 1.029124159 -0.628000387 -1.158823921 -0.338013959 2.869980050
[71] -1.554700511 -2.068220434 -1.151213128 -0.061121949 -1.509932518
[76] -1.277043279 -1.652007259 1.937133265 1.729874376 0.903688744
[81] 0.351118684 -0.700192536 -0.717916433 -0.483694773 1.761875160
[86] 1.436517428 -0.538413065 0.382136712 0.988099262 0.051769978
[91] -0.992602066 -0.390010931 -0.186667098 -0.447862282 0.569867694
[96] -0.955126428 0.159752051 -0.395755316 0.582617654 -1.063122984
> 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.061008215 -0.309738066 -0.911656865 -0.727595589 -0.010508252
[6] 0.878722621 -2.033393827 0.004552393 -0.504984213 1.276035117
[11] -1.517587679 -1.056259671 -0.733781033 -1.351337238 -0.023608110
[16] 1.656402792 0.292845223 0.479777881 0.697078727 0.983536282
[21] -1.219481048 1.705511041 -1.617917065 -0.101641197 0.856881385
[26] -0.018081289 -0.556935013 -0.501822979 0.914381185 -1.019067382
[31] -0.559775096 -0.675456895 -1.407880665 -0.723854581 1.351500401
[36] 1.896049035 1.929054588 1.244896848 1.953291458 -0.014264711
[41] 0.121525177 -1.952890293 0.701444039 0.207196513 0.158001560
[46] 0.138972257 -1.076510305 1.809829403 -0.562184215 -2.537715254
[51] 0.669224397 0.015370724 1.320027407 -0.736431250 -0.179437909
[56] -1.891064274 -0.314102035 0.066317450 -1.905362828 0.003257189
[61] 0.918886704 0.606020422 1.434640187 -1.110144480 -1.725424847
[66] 1.029124159 -0.628000387 -1.158823921 -0.338013959 2.869980050
[71] -1.554700511 -2.068220434 -1.151213128 -0.061121949 -1.509932518
[76] -1.277043279 -1.652007259 1.937133265 1.729874376 0.903688744
[81] 0.351118684 -0.700192536 -0.717916433 -0.483694773 1.761875160
[86] 1.436517428 -0.538413065 0.382136712 0.988099262 0.051769978
[91] -0.992602066 -0.390010931 -0.186667098 -0.447862282 0.569867694
[96] -0.955126428 0.159752051 -0.395755316 0.582617654 -1.063122984
> colMin(tmp)
[1] 0.061008215 -0.309738066 -0.911656865 -0.727595589 -0.010508252
[6] 0.878722621 -2.033393827 0.004552393 -0.504984213 1.276035117
[11] -1.517587679 -1.056259671 -0.733781033 -1.351337238 -0.023608110
[16] 1.656402792 0.292845223 0.479777881 0.697078727 0.983536282
[21] -1.219481048 1.705511041 -1.617917065 -0.101641197 0.856881385
[26] -0.018081289 -0.556935013 -0.501822979 0.914381185 -1.019067382
[31] -0.559775096 -0.675456895 -1.407880665 -0.723854581 1.351500401
[36] 1.896049035 1.929054588 1.244896848 1.953291458 -0.014264711
[41] 0.121525177 -1.952890293 0.701444039 0.207196513 0.158001560
[46] 0.138972257 -1.076510305 1.809829403 -0.562184215 -2.537715254
[51] 0.669224397 0.015370724 1.320027407 -0.736431250 -0.179437909
[56] -1.891064274 -0.314102035 0.066317450 -1.905362828 0.003257189
[61] 0.918886704 0.606020422 1.434640187 -1.110144480 -1.725424847
[66] 1.029124159 -0.628000387 -1.158823921 -0.338013959 2.869980050
[71] -1.554700511 -2.068220434 -1.151213128 -0.061121949 -1.509932518
[76] -1.277043279 -1.652007259 1.937133265 1.729874376 0.903688744
[81] 0.351118684 -0.700192536 -0.717916433 -0.483694773 1.761875160
[86] 1.436517428 -0.538413065 0.382136712 0.988099262 0.051769978
[91] -0.992602066 -0.390010931 -0.186667098 -0.447862282 0.569867694
[96] -0.955126428 0.159752051 -0.395755316 0.582617654 -1.063122984
> colMedians(tmp)
[1] 0.061008215 -0.309738066 -0.911656865 -0.727595589 -0.010508252
[6] 0.878722621 -2.033393827 0.004552393 -0.504984213 1.276035117
[11] -1.517587679 -1.056259671 -0.733781033 -1.351337238 -0.023608110
[16] 1.656402792 0.292845223 0.479777881 0.697078727 0.983536282
[21] -1.219481048 1.705511041 -1.617917065 -0.101641197 0.856881385
[26] -0.018081289 -0.556935013 -0.501822979 0.914381185 -1.019067382
[31] -0.559775096 -0.675456895 -1.407880665 -0.723854581 1.351500401
[36] 1.896049035 1.929054588 1.244896848 1.953291458 -0.014264711
[41] 0.121525177 -1.952890293 0.701444039 0.207196513 0.158001560
[46] 0.138972257 -1.076510305 1.809829403 -0.562184215 -2.537715254
[51] 0.669224397 0.015370724 1.320027407 -0.736431250 -0.179437909
[56] -1.891064274 -0.314102035 0.066317450 -1.905362828 0.003257189
[61] 0.918886704 0.606020422 1.434640187 -1.110144480 -1.725424847
[66] 1.029124159 -0.628000387 -1.158823921 -0.338013959 2.869980050
[71] -1.554700511 -2.068220434 -1.151213128 -0.061121949 -1.509932518
[76] -1.277043279 -1.652007259 1.937133265 1.729874376 0.903688744
[81] 0.351118684 -0.700192536 -0.717916433 -0.483694773 1.761875160
[86] 1.436517428 -0.538413065 0.382136712 0.988099262 0.051769978
[91] -0.992602066 -0.390010931 -0.186667098 -0.447862282 0.569867694
[96] -0.955126428 0.159752051 -0.395755316 0.582617654 -1.063122984
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.06100821 -0.3097381 -0.9116569 -0.7275956 -0.01050825 0.8787226
[2,] 0.06100821 -0.3097381 -0.9116569 -0.7275956 -0.01050825 0.8787226
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] -2.033394 0.004552393 -0.5049842 1.276035 -1.517588 -1.05626 -0.733781
[2,] -2.033394 0.004552393 -0.5049842 1.276035 -1.517588 -1.05626 -0.733781
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] -1.351337 -0.02360811 1.656403 0.2928452 0.4797779 0.6970787 0.9835363
[2,] -1.351337 -0.02360811 1.656403 0.2928452 0.4797779 0.6970787 0.9835363
[,21] [,22] [,23] [,24] [,25] [,26] [,27]
[1,] -1.219481 1.705511 -1.617917 -0.1016412 0.8568814 -0.01808129 -0.556935
[2,] -1.219481 1.705511 -1.617917 -0.1016412 0.8568814 -0.01808129 -0.556935
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] -0.501823 0.9143812 -1.019067 -0.5597751 -0.6754569 -1.407881 -0.7238546
[2,] -0.501823 0.9143812 -1.019067 -0.5597751 -0.6754569 -1.407881 -0.7238546
[,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.3515 1.896049 1.929055 1.244897 1.953291 -0.01426471 0.1215252 -1.95289
[2,] 1.3515 1.896049 1.929055 1.244897 1.953291 -0.01426471 0.1215252 -1.95289
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.701444 0.2071965 0.1580016 0.1389723 -1.07651 1.809829 -0.5621842
[2,] 0.701444 0.2071965 0.1580016 0.1389723 -1.07651 1.809829 -0.5621842
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -2.537715 0.6692244 0.01537072 1.320027 -0.7364312 -0.1794379 -1.891064
[2,] -2.537715 0.6692244 0.01537072 1.320027 -0.7364312 -0.1794379 -1.891064
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.314102 0.06631745 -1.905363 0.003257189 0.9188867 0.6060204 1.43464
[2,] -0.314102 0.06631745 -1.905363 0.003257189 0.9188867 0.6060204 1.43464
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.110144 -1.725425 1.029124 -0.6280004 -1.158824 -0.338014 2.86998
[2,] -1.110144 -1.725425 1.029124 -0.6280004 -1.158824 -0.338014 2.86998
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.554701 -2.06822 -1.151213 -0.06112195 -1.509933 -1.277043 -1.652007
[2,] -1.554701 -2.06822 -1.151213 -0.06112195 -1.509933 -1.277043 -1.652007
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.937133 1.729874 0.9036887 0.3511187 -0.7001925 -0.7179164 -0.4836948
[2,] 1.937133 1.729874 0.9036887 0.3511187 -0.7001925 -0.7179164 -0.4836948
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.761875 1.436517 -0.5384131 0.3821367 0.9880993 0.05176998 -0.9926021
[2,] 1.761875 1.436517 -0.5384131 0.3821367 0.9880993 0.05176998 -0.9926021
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.3900109 -0.1866671 -0.4478623 0.5698677 -0.9551264 0.1597521 -0.3957553
[2,] -0.3900109 -0.1866671 -0.4478623 0.5698677 -0.9551264 0.1597521 -0.3957553
[,99] [,100]
[1,] 0.5826177 -1.063123
[2,] 0.5826177 -1.063123
>
>
> Max(tmp2)
[1] 2.256471
> Min(tmp2)
[1] -2.279519
> mean(tmp2)
[1] -0.05199492
> Sum(tmp2)
[1] -5.199492
> Var(tmp2)
[1] 1.093829
>
> rowMeans(tmp2)
[1] -0.876582592 -1.118693810 -1.609648322 -0.578427934 -0.112556813
[6] 1.305012918 0.399188115 -0.730542673 0.098433046 -0.328994810
[11] -0.681679098 -1.286191620 -0.996520880 -0.624275173 -0.073074043
[16] -0.965595762 1.096337042 -0.387336115 -0.173619438 -1.562837182
[21] 0.144389131 -0.213776838 -0.447878996 0.403131963 0.916296220
[26] -1.375048589 0.533171762 0.130855523 -2.174417011 1.428602490
[31] -1.622556810 -0.455579273 1.305231591 -1.877241644 0.189203478
[36] -0.733168826 0.994900278 0.557239228 0.331750829 -0.559930124
[41] -2.279519488 -1.784818548 -0.406981398 0.291989237 2.077040762
[46] -0.058592668 -0.742111592 1.220173819 -1.893170876 -0.665018928
[51] -0.608100032 1.654328571 -0.429727548 -0.751983547 -1.282656625
[56] 1.180758499 1.805009658 -0.208778443 -0.318341757 0.128367171
[61] 0.408634094 0.086716465 -0.172708904 1.132183752 0.486847027
[66] 0.213462661 -0.085448502 2.256470811 -0.711707816 -0.036114783
[71] -0.417877221 -1.135974183 0.096709810 1.075015522 0.526991253
[76] -1.362137358 0.560841059 -0.001789102 -1.289041636 -1.196922783
[81] -0.101364800 1.157540543 -1.505568638 0.278372330 1.005914985
[86] -1.011456187 1.393928870 1.128311062 -0.481045952 2.117845890
[91] 2.203945407 1.126123211 -1.686515148 1.288067170 0.252063842
[96] -0.296978810 0.955262567 1.173662525 0.634426493 -0.461613486
> rowSums(tmp2)
[1] -0.876582592 -1.118693810 -1.609648322 -0.578427934 -0.112556813
[6] 1.305012918 0.399188115 -0.730542673 0.098433046 -0.328994810
[11] -0.681679098 -1.286191620 -0.996520880 -0.624275173 -0.073074043
[16] -0.965595762 1.096337042 -0.387336115 -0.173619438 -1.562837182
[21] 0.144389131 -0.213776838 -0.447878996 0.403131963 0.916296220
[26] -1.375048589 0.533171762 0.130855523 -2.174417011 1.428602490
[31] -1.622556810 -0.455579273 1.305231591 -1.877241644 0.189203478
[36] -0.733168826 0.994900278 0.557239228 0.331750829 -0.559930124
[41] -2.279519488 -1.784818548 -0.406981398 0.291989237 2.077040762
[46] -0.058592668 -0.742111592 1.220173819 -1.893170876 -0.665018928
[51] -0.608100032 1.654328571 -0.429727548 -0.751983547 -1.282656625
[56] 1.180758499 1.805009658 -0.208778443 -0.318341757 0.128367171
[61] 0.408634094 0.086716465 -0.172708904 1.132183752 0.486847027
[66] 0.213462661 -0.085448502 2.256470811 -0.711707816 -0.036114783
[71] -0.417877221 -1.135974183 0.096709810 1.075015522 0.526991253
[76] -1.362137358 0.560841059 -0.001789102 -1.289041636 -1.196922783
[81] -0.101364800 1.157540543 -1.505568638 0.278372330 1.005914985
[86] -1.011456187 1.393928870 1.128311062 -0.481045952 2.117845890
[91] 2.203945407 1.126123211 -1.686515148 1.288067170 0.252063842
[96] -0.296978810 0.955262567 1.173662525 0.634426493 -0.461613486
> 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.876582592 -1.118693810 -1.609648322 -0.578427934 -0.112556813
[6] 1.305012918 0.399188115 -0.730542673 0.098433046 -0.328994810
[11] -0.681679098 -1.286191620 -0.996520880 -0.624275173 -0.073074043
[16] -0.965595762 1.096337042 -0.387336115 -0.173619438 -1.562837182
[21] 0.144389131 -0.213776838 -0.447878996 0.403131963 0.916296220
[26] -1.375048589 0.533171762 0.130855523 -2.174417011 1.428602490
[31] -1.622556810 -0.455579273 1.305231591 -1.877241644 0.189203478
[36] -0.733168826 0.994900278 0.557239228 0.331750829 -0.559930124
[41] -2.279519488 -1.784818548 -0.406981398 0.291989237 2.077040762
[46] -0.058592668 -0.742111592 1.220173819 -1.893170876 -0.665018928
[51] -0.608100032 1.654328571 -0.429727548 -0.751983547 -1.282656625
[56] 1.180758499 1.805009658 -0.208778443 -0.318341757 0.128367171
[61] 0.408634094 0.086716465 -0.172708904 1.132183752 0.486847027
[66] 0.213462661 -0.085448502 2.256470811 -0.711707816 -0.036114783
[71] -0.417877221 -1.135974183 0.096709810 1.075015522 0.526991253
[76] -1.362137358 0.560841059 -0.001789102 -1.289041636 -1.196922783
[81] -0.101364800 1.157540543 -1.505568638 0.278372330 1.005914985
[86] -1.011456187 1.393928870 1.128311062 -0.481045952 2.117845890
[91] 2.203945407 1.126123211 -1.686515148 1.288067170 0.252063842
[96] -0.296978810 0.955262567 1.173662525 0.634426493 -0.461613486
> rowMin(tmp2)
[1] -0.876582592 -1.118693810 -1.609648322 -0.578427934 -0.112556813
[6] 1.305012918 0.399188115 -0.730542673 0.098433046 -0.328994810
[11] -0.681679098 -1.286191620 -0.996520880 -0.624275173 -0.073074043
[16] -0.965595762 1.096337042 -0.387336115 -0.173619438 -1.562837182
[21] 0.144389131 -0.213776838 -0.447878996 0.403131963 0.916296220
[26] -1.375048589 0.533171762 0.130855523 -2.174417011 1.428602490
[31] -1.622556810 -0.455579273 1.305231591 -1.877241644 0.189203478
[36] -0.733168826 0.994900278 0.557239228 0.331750829 -0.559930124
[41] -2.279519488 -1.784818548 -0.406981398 0.291989237 2.077040762
[46] -0.058592668 -0.742111592 1.220173819 -1.893170876 -0.665018928
[51] -0.608100032 1.654328571 -0.429727548 -0.751983547 -1.282656625
[56] 1.180758499 1.805009658 -0.208778443 -0.318341757 0.128367171
[61] 0.408634094 0.086716465 -0.172708904 1.132183752 0.486847027
[66] 0.213462661 -0.085448502 2.256470811 -0.711707816 -0.036114783
[71] -0.417877221 -1.135974183 0.096709810 1.075015522 0.526991253
[76] -1.362137358 0.560841059 -0.001789102 -1.289041636 -1.196922783
[81] -0.101364800 1.157540543 -1.505568638 0.278372330 1.005914985
[86] -1.011456187 1.393928870 1.128311062 -0.481045952 2.117845890
[91] 2.203945407 1.126123211 -1.686515148 1.288067170 0.252063842
[96] -0.296978810 0.955262567 1.173662525 0.634426493 -0.461613486
>
> colMeans(tmp2)
[1] -0.05199492
> colSums(tmp2)
[1] -5.199492
> colVars(tmp2)
[1] 1.093829
> colSd(tmp2)
[1] 1.045863
> colMax(tmp2)
[1] 2.256471
> colMin(tmp2)
[1] -2.279519
> colMedians(tmp2)
[1] -0.09340665
> colRanges(tmp2)
[,1]
[1,] -2.279519
[2,] 2.256471
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 4.78775841 -5.59255564 1.00499691 1.67547282 -3.26650821 3.18487501
[7] 0.62086575 -2.04596639 -0.03579767 -3.23242346
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6166803
[2,] -0.2907810
[3,] 0.7902064
[4,] 1.3607517
[5,] 1.8632616
>
> rowApply(tmp,sum)
[1] -0.66056823 2.88272285 0.04374878 1.48033616 0.41422667 -1.13726869
[7] 1.86041537 -4.41589306 -1.83874837 -1.52825394
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 10 6 10 9 4 9 2 8 9
[2,] 1 6 8 6 3 3 4 4 1 2
[3,] 4 5 2 8 6 8 8 7 6 7
[4,] 9 3 10 5 7 7 2 8 2 6
[5,] 7 4 3 3 10 1 3 10 7 1
[6,] 6 7 5 9 8 9 6 5 4 5
[7,] 2 8 4 4 4 6 7 9 10 3
[8,] 8 1 9 7 5 10 1 1 5 4
[9,] 10 9 1 1 1 5 10 3 9 8
[10,] 5 2 7 2 2 2 5 6 3 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.1619325 0.4872117 -2.6720476 -2.3439565 2.7352484 -0.6593420
[7] -0.6936869 -2.1913372 -2.0986062 0.2160324 0.3283782 1.6079536
[13] -0.6566439 -2.2354760 1.5534422 3.5626364 -0.5589895 -0.9766906
[19] -0.5591899 0.2615205
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.73783547
[2,] -0.01852282
[3,] 0.05739837
[4,] 1.28120502
[5,] 1.57968737
>
> rowApply(tmp,sum)
[1] -5.558222 -2.437449 1.622809 1.065205 2.576047
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 13 9 5 17
[2,] 13 2 19 17 6
[3,] 4 10 5 15 2
[4,] 10 9 1 12 5
[5,] 12 19 10 11 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.57968737 -0.001742193 -1.20259388 -0.20404728 -0.01416306 -0.06629178
[2,] 0.05739837 -1.485152375 -0.05593291 -0.09556824 1.40108786 0.11355629
[3,] -0.01852282 1.239427055 -0.75709016 -1.64735422 0.03090369 0.45778003
[4,] -0.73783547 0.927314861 0.14435388 0.02210595 0.01575832 -0.56063470
[5,] 1.28120502 -0.192635680 -0.80078452 -0.41909270 1.30166155 -0.60375180
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.8913061 -0.68230306 -1.1034758 0.6632082 0.29077178 0.05513791
[2,] 0.3630991 -2.08572988 -0.4177584 0.4163031 -0.98786850 0.03804846
[3,] 0.4830333 0.81362665 0.4490863 0.5925634 -0.30131170 0.82044206
[4,] -0.7870457 -0.15001183 -0.8667183 -0.7353403 1.38168403 0.34138513
[5,] 0.1385325 -0.08691909 -0.1597399 -0.7207019 -0.05489746 0.35294002
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.27443624 0.14799333 -0.4489677 0.86287941 -1.8712980 0.7077900
[2,] 0.01718327 0.33468909 -0.1873487 1.87350162 -0.3210806 -0.8957496
[3,] -0.84261302 -0.03245563 -0.8643718 0.15281074 2.1170845 -1.4232312
[4,] 0.09280205 -0.95607041 2.9308677 0.05842069 -0.6299436 -0.1437127
[5,] 1.35042001 -1.72963234 0.1232628 0.61502398 0.1462481 0.7782129
[,19] [,20]
[1,] -1.7883763 -0.31668845
[2,] -1.2653764 0.74524911
[3,] -0.3444666 0.69746817
[4,] 1.5135630 -0.79573773
[5,] 1.3254664 -0.06877061
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.1824281 0.6961465 0.9236393 -1.290198 1.649106 0.6568116 -0.4064678
col8 col9 col10 col11 col12 col13 col14
row1 0.1855575 0.1455787 -1.285565 1.154543 0.2996051 1.295587 0.1016681
col15 col16 col17 col18 col19 col20
row1 0.6577943 -0.8618272 1.421479 -1.193589 -0.4188951 -0.6876381
> tmp[,"col10"]
col10
row1 -1.2855651
row2 0.2238583
row3 1.2918690
row4 1.8555815
row5 -1.6251206
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.1824281 0.6961465 0.9236393 -1.290198 1.6491062 0.6568116 -0.4064678
row5 0.1440286 -0.2706574 1.0563507 1.196400 0.7034354 0.1718508 1.5622462
col8 col9 col10 col11 col12 col13 col14
row1 0.1855575 0.1455787 -1.285565 1.15454265 0.2996051 1.2955872 0.1016681
row5 -0.8321797 0.6216897 -1.625121 0.01311033 -1.0280458 0.5675707 -1.3746569
col15 col16 col17 col18 col19 col20
row1 0.6577943 -0.8618272 1.421479 -1.193589 -0.4188951 -0.6876381
row5 -0.2864332 -0.3057551 1.005862 0.164840 0.1405992 -0.1028723
> tmp[,c("col6","col20")]
col6 col20
row1 0.6568116 -0.6876381
row2 -0.8722449 0.8235871
row3 0.4637188 0.6839619
row4 -0.5907938 -1.5122406
row5 0.1718508 -0.1028723
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.6568116 -0.6876381
row5 0.1718508 -0.1028723
>
>
>
>
> 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.25108 48.10944 48.90397 48.57105 49.92168 102.9451 48.80517 49.78465
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.28633 48.32617 48.68815 49.5505 49.7946 52.35976 50.51721 48.97948
col17 col18 col19 col20
row1 50.35162 49.42628 49.68516 106.0067
> tmp[,"col10"]
col10
row1 48.32617
row2 27.94202
row3 29.97658
row4 31.23004
row5 50.01083
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.25108 48.10944 48.90397 48.57105 49.92168 102.9451 48.80517 49.78465
row5 47.76456 50.88709 47.90194 49.56623 53.36955 104.2347 51.11799 50.39923
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.28633 48.32617 48.68815 49.55050 49.79460 52.35976 50.51721 48.97948
row5 49.94833 50.01083 49.09318 50.49466 50.61943 49.19213 48.61408 50.91202
col17 col18 col19 col20
row1 50.35162 49.42628 49.68516 106.0067
row5 51.87694 51.34753 50.28111 105.8862
> tmp[,c("col6","col20")]
col6 col20
row1 102.94506 106.00672
row2 75.58615 73.75966
row3 75.13088 76.09367
row4 75.35118 74.43125
row5 104.23466 105.88615
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 102.9451 106.0067
row5 104.2347 105.8862
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 102.9451 106.0067
row5 104.2347 105.8862
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.9772915
[2,] -0.9397083
[3,] 0.6025928
[4,] 1.2712040
[5,] 0.1010626
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.70839452 0.71158002
[2,] -0.22993560 0.55909958
[3,] 0.41652575 0.81951385
[4,] -0.06029521 -0.82098039
[5,] -0.99403701 -0.09911757
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.1048538 0.6231920
[2,] 0.5217086 -1.1380837
[3,] 0.1152221 0.3727455
[4,] -0.5041066 -0.8927188
[5,] 1.0017741 -0.2605673
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.104854
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.1048538
[2,] 0.5217086
>
>
>
> 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 -1.369675 -0.9636540 0.22787056 -0.897190 0.4081166 1.2822949
row1 -1.377860 0.4268304 -0.02409263 -3.875451 -0.4067534 -0.3658402
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.09621672 -2.2985322 -1.4477807 -0.3004109 -0.05023413 -1.398383
row1 2.23596115 -0.9368141 -0.7358339 -0.3740853 1.10299473 -1.042066
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 -1.3622406 -1.867473 2.302360 -0.5024111 -1.8514385 -0.7337705 -0.5022484
row1 0.6846575 -1.123008 1.173475 0.3536716 0.8437272 0.5014603 1.4092182
[,20]
row3 0.6229783
row1 -0.1422962
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6]
row2 -2.390079 -0.6049721 0.08812916 -0.2560074 -0.4030332 -0.08052444
[,7] [,8] [,9] [,10]
row2 -0.6813124 0.4011981 -0.565399 -0.02393763
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.1310568 2.058402 -1.87912 0.3200109 0.6268807 1.038141 -0.583288
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.5192869 0.6045812 1.080433 0.1110678 0.7683981 0.7303819 1.146253
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.8693915 0.1005248 -0.1610669 -1.380354 -0.4879497 -0.6698651
>
>
> 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: 0x600000528000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f964e7d9397"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f961664c6c3"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96323537b1"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f9643db5f37"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96774836ae"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f9625fe16b0"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f964c83904c"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96517694d2"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96402490c6"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96209cd810"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96192d132a"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f965e45374f"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f96123253e3"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f962621656a"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9f965a8925b4"
>
>
> ### 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: 0x600000538060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000538060>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600000538060>
> rowMedians(tmp)
[1] -9.873091e-02 -6.665218e-01 -1.932003e-01 -1.408043e-01 3.052051e-01
[6] 3.774038e-02 5.604736e-02 1.681327e-01 6.460368e-01 -1.463023e-01
[11] -4.027939e-01 1.306648e-01 -1.728521e-01 3.551487e-02 -3.200909e-02
[16] -5.206351e-02 -3.198540e-01 3.620751e-01 2.361547e-01 4.787376e-01
[21] -1.914771e-01 2.685468e-01 -1.463995e-01 -1.524472e-01 -4.303186e-01
[26] 1.662016e-01 -5.941662e-01 2.404737e-01 2.200116e-01 -4.009623e-01
[31] 6.690103e-02 -1.213506e-01 1.866471e-01 -1.891695e-01 3.370153e-02
[36] 2.702255e-01 -1.007152e-01 1.368835e-01 8.440026e-01 2.122912e-01
[41] -1.862916e-02 -3.830806e-01 -1.953322e-01 -5.146012e-02 -7.103403e-01
[46] 3.193476e-01 -4.797998e-01 5.466233e-01 -4.733194e-01 2.950400e-01
[51] -3.607794e-01 -9.224426e-02 -2.577859e-01 2.349294e-01 -1.433078e-01
[56] -1.393575e-01 -2.543964e-01 4.074908e-01 5.486901e-01 2.938251e-01
[61] -1.267114e-01 3.336678e-01 2.917699e-01 1.357132e-01 -2.245944e-01
[66] -2.202808e-02 1.155785e-01 6.523086e-01 1.977262e-01 2.523114e-01
[71] -2.622122e-01 -5.475804e-01 3.794434e-01 3.715916e-01 -2.239840e-03
[76] 1.687459e-01 -4.020620e-01 -3.473691e-01 -9.950562e-02 -3.722290e-01
[81] -4.491538e-01 2.402836e-01 -4.497340e-01 -3.437099e-01 -4.065731e-01
[86] -3.874009e-01 -2.942776e-01 1.422502e-01 2.220824e-01 -6.723850e-02
[91] -2.580550e-01 7.667703e-02 -8.323984e-01 -2.659685e-01 4.996852e-02
[96] 5.026026e-01 5.523725e-02 3.365545e-01 -4.938717e-02 8.195349e-02
[101] 3.419481e-01 6.243962e-01 2.720620e-01 2.572377e-02 2.291197e-01
[106] 4.011179e-01 -1.316071e-01 -2.441083e-01 2.016238e-01 4.228962e-01
[111] 1.573325e-01 -1.333051e-01 3.009926e-01 4.395932e-01 6.269777e-03
[116] -6.752412e-01 -1.291586e-01 -2.201282e-02 -2.249168e-01 3.441958e-01
[121] -2.003968e-01 3.346484e-01 1.349866e-01 -7.444028e-02 8.244920e-02
[126] -1.057477e-01 3.929436e-02 1.074099e-01 -5.020343e-01 1.353502e-01
[131] 1.312771e-01 -2.393276e-05 -3.419862e-01 3.115212e-02 -3.324050e-01
[136] -1.710377e-01 2.589323e-01 3.498219e-01 6.744935e-01 -3.717673e-01
[141] 5.447050e-02 3.857561e-01 2.617707e-01 -3.973918e-01 6.284997e-01
[146] -6.995707e-02 3.029467e-01 1.574141e-01 2.146944e-01 -2.619628e-02
[151] -2.757445e-01 1.770788e-01 -2.790754e-01 -4.337670e-01 2.560169e-01
[156] 2.801904e-01 -4.091178e-01 -9.738623e-02 2.364939e-01 5.364821e-02
[161] 1.284744e-01 1.819690e-01 -1.566016e-01 -8.665733e-02 4.763752e-01
[166] -1.865514e-01 4.459072e-01 2.301324e-01 3.596315e-02 8.408091e-02
[171] -4.893390e-01 1.992010e-01 2.949233e-01 -1.710484e-01 -1.993185e-01
[176] 2.050973e-01 1.357814e-01 -1.097410e-01 1.174866e-01 1.348966e-01
[181] 2.016491e-01 -3.173094e-01 9.331291e-02 2.240977e-01 -1.247893e-01
[186] -2.900751e-01 -1.969368e-01 -1.549552e-01 2.184175e-01 1.856425e-01
[191] 9.293662e-02 2.409414e-01 1.435800e-01 3.941747e-01 -1.743364e-01
[196] 3.943912e-01 1.590167e-01 1.133887e-01 8.392730e-02 -4.872098e-01
[201] 3.408990e-01 2.813281e-01 4.290268e-02 -2.699602e-01 -2.341708e-01
[206] 6.138410e-01 2.083508e-01 -1.361561e-01 -9.747282e-02 -5.033847e-02
[211] 3.999756e-02 -9.559536e-03 2.467506e-02 1.464999e-01 -1.493666e-01
[216] 2.540425e-01 1.150279e-01 -6.305164e-02 5.072643e-01 3.386050e-01
[221] -1.881232e-01 -3.194779e-01 8.199890e-02 -1.069159e-01 3.228205e-02
[226] 2.855144e-01 -4.536951e-01 -2.559407e-01 4.507586e-02 -4.605018e-01
>
> proc.time()
user system elapsed
2.670 14.730 17.815
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x6000025c8000>
> .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: 0x6000025c8000>
> .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: 0x6000025c8000>
> .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: 0x6000025c8000>
> 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: 0x6000025b0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025b0000>
> .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: 0x6000025b0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025b0000>
> .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: 0x6000025b0000>
> 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: 0x6000025b8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025b8000>
> .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: 0x6000025b8000>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000025b8000>
> .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: 0x6000025b8000>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000025b8000>
> .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: 0x6000025b8000>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000025b8000>
> .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: 0x6000025b8000>
> 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: 0x6000025bc000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000025bc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025bc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025bc000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea48016aa1b9e" "BufferedMatrixFilea48079fb2db1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea48016aa1b9e" "BufferedMatrixFilea48079fb2db1"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025bc240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025bc240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000025bc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000025bc240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000025bc240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000025bc240>
> .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: 0x6000025c0300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025c0300>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000025c0300>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000025c0300>
> 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: 0x6000025c0480>
> .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: 0x6000025c0480>
> rm(P)
>
> proc.time()
user system elapsed
0.316 0.159 0.486
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.314 0.096 0.431