| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-16 11:11 -0500 (Fri, 16 Jan 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" | 4849 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4628 |
| 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 253/2343 | 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 | |||||||||
| 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: 2026-01-15 18:54:07 -0500 (Thu, 15 Jan 2026) |
| EndedAt: 2026-01-15 18:54:28 -0500 (Thu, 15 Jan 2026) |
| EllapsedTime: 21.3 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-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
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 15.0.0 (clang-1500.1.0.2.5)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/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 arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/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-arm64/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-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.128 0.058 0.190
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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 481248 25.8 1058085 56.6 NA 633817 33.9
Vcells 891449 6.9 8388608 64.0 196608 2110969 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Jan 15 18:54:18 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Jan 15 18:54:18 2026"
>
>
> 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: 0x600003d68000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Jan 15 18:54:20 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Jan 15 18:54:20 2026"
>
> ColMode(tmp2)
<pointer: 0x600003d68000>
>
>
>
> ### 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,] 99.5538425 0.1797911 -0.07071973 -0.37000749
[2,] 0.1691509 1.1676627 -0.36319848 -0.45169587
[3,] 0.4825276 -1.1886594 0.34996715 -0.08255321
[4,] 0.1469326 -0.5324848 -0.80705947 -0.06140547
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.5538425 0.1797911 0.07071973 0.37000749
[2,] 0.1691509 1.1676627 0.36319848 0.45169587
[3,] 0.4825276 1.1886594 0.34996715 0.08255321
[4,] 0.1469326 0.5324848 0.80705947 0.06140547
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9776672 0.4240178 0.2659318 0.6082824
[2,] 0.4112796 1.0805844 0.6026595 0.6720832
[3,] 0.6946421 1.0902566 0.5915802 0.2873207
[4,] 0.3833178 0.7297156 0.8983649 0.2478013
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.33051 29.41997 27.73004 31.45283
[2,] 29.28195 36.97351 31.38979 32.17253
[3,] 32.42895 37.09123 31.26577 27.95576
[4,] 28.98011 32.82964 34.79071 27.53942
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003d7c540>
> exp(tmp5)
<pointer: 0x600003d7c540>
> log(tmp5,2)
<pointer: 0x600003d7c540>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.9146
> Min(tmp5)
[1] 52.61305
> mean(tmp5)
[1] 71.78983
> Sum(tmp5)
[1] 14357.97
> Var(tmp5)
[1] 863.9854
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 87.04654 68.53608 68.62595 69.46738 70.41608 73.12876 69.68820 69.92209
[9] 70.64206 70.42516
> rowSums(tmp5)
[1] 1740.931 1370.722 1372.519 1389.348 1408.322 1462.575 1393.764 1398.442
[9] 1412.841 1408.503
> rowVars(tmp5)
[1] 8051.01273 99.18243 87.56456 84.54315 55.52395 66.19098
[7] 79.13054 80.28319 63.66568 94.09409
> rowSd(tmp5)
[1] 89.727436 9.959038 9.357594 9.194735 7.451439 8.135784 8.895535
[8] 8.960089 7.979078 9.700211
> rowMax(tmp5)
[1] 466.91457 90.07244 83.46568 87.32312 84.24660 85.72072 92.14284
[8] 85.04428 85.00814 90.86084
> rowMin(tmp5)
[1] 55.56939 52.61305 54.56006 54.68295 57.48631 57.12202 55.22481 55.79045
[9] 57.44109 55.99236
>
> colMeans(tmp5)
[1] 108.42848 73.18255 72.84060 66.49038 68.69157 66.54261 69.38099
[8] 72.72463 66.47891 72.29043 69.46708 69.52749 68.33108 73.14178
[15] 71.80281 69.57619 68.49245 74.22364 66.75558 67.42736
> colSums(tmp5)
[1] 1084.2848 731.8255 728.4060 664.9038 686.9157 665.4261 693.8099
[8] 727.2463 664.7891 722.9043 694.6708 695.2749 683.3108 731.4178
[15] 718.0281 695.7619 684.9245 742.2364 667.5558 674.2736
> colVars(tmp5)
[1] 15935.719703 67.857032 68.483522 53.744289 66.820601
[6] 70.165839 97.619796 62.207215 72.904524 49.981958
[11] 70.839383 117.701489 41.513152 112.541075 117.258868
[16] 111.095825 90.342623 127.081029 9.817049 53.138055
> colSd(tmp5)
[1] 126.236761 8.237538 8.275477 7.331050 8.174387 8.376505
[7] 9.880273 7.887155 8.538415 7.069792 8.416613 10.849032
[13] 6.443070 10.608538 10.828613 10.540200 9.504874 11.273022
[19] 3.133217 7.289585
> colMax(tmp5)
[1] 466.91457 85.72072 85.00814 83.10620 80.57336 83.35648 82.95438
[8] 85.42793 77.27614 82.29545 83.46568 81.47588 79.22262 92.14284
[15] 88.50961 83.26737 82.58241 90.86084 71.32849 80.30722
> colMin(tmp5)
[1] 58.18220 61.23381 57.71644 57.31969 57.36435 57.44109 54.56006 60.27984
[9] 55.06091 63.88899 57.28726 55.22481 58.57744 61.01800 56.73742 52.61305
[17] 55.56939 54.68295 62.04071 56.91035
>
>
> ### 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] 87.04654 NA 68.62595 69.46738 70.41608 73.12876 69.68820 69.92209
[9] 70.64206 70.42516
> rowSums(tmp5)
[1] 1740.931 NA 1372.519 1389.348 1408.322 1462.575 1393.764 1398.442
[9] 1412.841 1408.503
> rowVars(tmp5)
[1] 8051.01273 104.09286 87.56456 84.54315 55.52395 66.19098
[7] 79.13054 80.28319 63.66568 94.09409
> rowSd(tmp5)
[1] 89.727436 10.202591 9.357594 9.194735 7.451439 8.135784 8.895535
[8] 8.960089 7.979078 9.700211
> rowMax(tmp5)
[1] 466.91457 NA 83.46568 87.32312 84.24660 85.72072 92.14284
[8] 85.04428 85.00814 90.86084
> rowMin(tmp5)
[1] 55.56939 NA 54.56006 54.68295 57.48631 57.12202 55.22481 55.79045
[9] 57.44109 55.99236
>
> colMeans(tmp5)
[1] 108.42848 73.18255 NA 66.49038 68.69157 66.54261 69.38099
[8] 72.72463 66.47891 72.29043 69.46708 69.52749 68.33108 73.14178
[15] 71.80281 69.57619 68.49245 74.22364 66.75558 67.42736
> colSums(tmp5)
[1] 1084.2848 731.8255 NA 664.9038 686.9157 665.4261 693.8099
[8] 727.2463 664.7891 722.9043 694.6708 695.2749 683.3108 731.4178
[15] 718.0281 695.7619 684.9245 742.2364 667.5558 674.2736
> colVars(tmp5)
[1] 15935.719703 67.857032 NA 53.744289 66.820601
[6] 70.165839 97.619796 62.207215 72.904524 49.981958
[11] 70.839383 117.701489 41.513152 112.541075 117.258868
[16] 111.095825 90.342623 127.081029 9.817049 53.138055
> colSd(tmp5)
[1] 126.236761 8.237538 NA 7.331050 8.174387 8.376505
[7] 9.880273 7.887155 8.538415 7.069792 8.416613 10.849032
[13] 6.443070 10.608538 10.828613 10.540200 9.504874 11.273022
[19] 3.133217 7.289585
> colMax(tmp5)
[1] 466.91457 85.72072 NA 83.10620 80.57336 83.35648 82.95438
[8] 85.42793 77.27614 82.29545 83.46568 81.47588 79.22262 92.14284
[15] 88.50961 83.26737 82.58241 90.86084 71.32849 80.30722
> colMin(tmp5)
[1] 58.18220 61.23381 NA 57.31969 57.36435 57.44109 54.56006 60.27984
[9] 55.06091 63.88899 57.28726 55.22481 58.57744 61.01800 56.73742 52.61305
[17] 55.56939 54.68295 62.04071 56.91035
>
> Max(tmp5,na.rm=TRUE)
[1] 466.9146
> Min(tmp5,na.rm=TRUE)
[1] 52.61305
> mean(tmp5,na.rm=TRUE)
[1] 71.82227
> Sum(tmp5,na.rm=TRUE)
[1] 14292.63
> Var(tmp5,na.rm=TRUE)
[1] 868.1374
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.04654 68.70463 68.62595 69.46738 70.41608 73.12876 69.68820 69.92209
[9] 70.64206 70.42516
> rowSums(tmp5,na.rm=TRUE)
[1] 1740.931 1305.388 1372.519 1389.348 1408.322 1462.575 1393.764 1398.442
[9] 1412.841 1408.503
> rowVars(tmp5,na.rm=TRUE)
[1] 8051.01273 104.09286 87.56456 84.54315 55.52395 66.19098
[7] 79.13054 80.28319 63.66568 94.09409
> rowSd(tmp5,na.rm=TRUE)
[1] 89.727436 10.202591 9.357594 9.194735 7.451439 8.135784 8.895535
[8] 8.960089 7.979078 9.700211
> rowMax(tmp5,na.rm=TRUE)
[1] 466.91457 90.07244 83.46568 87.32312 84.24660 85.72072 92.14284
[8] 85.04428 85.00814 90.86084
> rowMin(tmp5,na.rm=TRUE)
[1] 55.56939 52.61305 54.56006 54.68295 57.48631 57.12202 55.22481 55.79045
[9] 57.44109 55.99236
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.42848 73.18255 73.67469 66.49038 68.69157 66.54261 69.38099
[8] 72.72463 66.47891 72.29043 69.46708 69.52749 68.33108 73.14178
[15] 71.80281 69.57619 68.49245 74.22364 66.75558 67.42736
> colSums(tmp5,na.rm=TRUE)
[1] 1084.2848 731.8255 663.0722 664.9038 686.9157 665.4261 693.8099
[8] 727.2463 664.7891 722.9043 694.6708 695.2749 683.3108 731.4178
[15] 718.0281 695.7619 684.9245 742.2364 667.5558 674.2736
> colVars(tmp5,na.rm=TRUE)
[1] 15935.719703 67.857032 69.217179 53.744289 66.820601
[6] 70.165839 97.619796 62.207215 72.904524 49.981958
[11] 70.839383 117.701489 41.513152 112.541075 117.258868
[16] 111.095825 90.342623 127.081029 9.817049 53.138055
> colSd(tmp5,na.rm=TRUE)
[1] 126.236761 8.237538 8.319686 7.331050 8.174387 8.376505
[7] 9.880273 7.887155 8.538415 7.069792 8.416613 10.849032
[13] 6.443070 10.608538 10.828613 10.540200 9.504874 11.273022
[19] 3.133217 7.289585
> colMax(tmp5,na.rm=TRUE)
[1] 466.91457 85.72072 85.00814 83.10620 80.57336 83.35648 82.95438
[8] 85.42793 77.27614 82.29545 83.46568 81.47588 79.22262 92.14284
[15] 88.50961 83.26737 82.58241 90.86084 71.32849 80.30722
> colMin(tmp5,na.rm=TRUE)
[1] 58.18220 61.23381 57.71644 57.31969 57.36435 57.44109 54.56006 60.27984
[9] 55.06091 63.88899 57.28726 55.22481 58.57744 61.01800 56.73742 52.61305
[17] 55.56939 54.68295 62.04071 56.91035
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 87.04654 NaN 68.62595 69.46738 70.41608 73.12876 69.68820 69.92209
[9] 70.64206 70.42516
> rowSums(tmp5,na.rm=TRUE)
[1] 1740.931 0.000 1372.519 1389.348 1408.322 1462.575 1393.764 1398.442
[9] 1412.841 1408.503
> rowVars(tmp5,na.rm=TRUE)
[1] 8051.01273 NA 87.56456 84.54315 55.52395 66.19098
[7] 79.13054 80.28319 63.66568 94.09409
> rowSd(tmp5,na.rm=TRUE)
[1] 89.727436 NA 9.357594 9.194735 7.451439 8.135784 8.895535
[8] 8.960089 7.979078 9.700211
> rowMax(tmp5,na.rm=TRUE)
[1] 466.91457 NA 83.46568 87.32312 84.24660 85.72072 92.14284
[8] 85.04428 85.00814 90.86084
> rowMin(tmp5,na.rm=TRUE)
[1] 55.56939 NA 54.56006 54.68295 57.48631 57.12202 55.22481 55.79045
[9] 57.44109 55.99236
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.70425 72.76333 NaN 66.43788 69.43015 67.08388 69.92659
[8] 71.31315 66.74531 72.17578 69.61152 70.86061 68.72964 71.26060
[15] 69.94649 71.46099 68.21244 74.78007 67.27946 67.63034
> colSums(tmp5,na.rm=TRUE)
[1] 1023.3383 654.8700 0.0000 597.9409 624.8713 603.7549 629.3393
[8] 641.8184 600.7078 649.5820 626.5037 637.7455 618.5667 641.3454
[15] 629.5184 643.1489 613.9120 673.0206 605.5151 608.6730
> colVars(tmp5,na.rm=TRUE)
[1] 17614.554788 74.362046 NA 60.431315 69.036367
[6] 75.640639 106.473422 47.570079 81.219187 56.081819
[11] 79.459593 112.420490 44.915245 86.796623 93.149940
[16] 85.017755 100.753401 139.482982 7.956672 59.316836
> colSd(tmp5,na.rm=TRUE)
[1] 132.719836 8.623343 NA 7.773758 8.308813 8.697163
[7] 10.318596 6.897107 9.012169 7.488780 8.914011 10.602853
[13] 6.701884 9.316471 9.651422 9.220507 10.037599 11.810291
[19] 2.820757 7.701742
> colMax(tmp5,na.rm=TRUE)
[1] 466.91457 85.72072 -Inf 83.10620 80.57336 83.35648 82.95438
[8] 79.18894 77.27614 82.29545 83.46568 81.47588 79.22262 92.14284
[15] 87.32312 83.26737 82.58241 90.86084 71.32849 80.30722
> colMin(tmp5,na.rm=TRUE)
[1] 58.18220 61.23381 Inf 57.31969 57.36435 57.44109 54.56006 60.27984
[9] 55.06091 63.88899 57.28726 55.22481 58.57744 61.01800 56.73742 57.47178
[17] 55.56939 54.68295 63.19274 56.91035
>
>
>
>
> 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] 117.47034 327.00320 99.77673 192.79703 199.17072 288.33996 269.87691
[8] 270.81764 340.86790 185.69385
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 117.47034 327.00320 99.77673 192.79703 199.17072 288.33996 269.87691
[8] 270.81764 340.86790 185.69385
>
>
>
> 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.136868e-13 0.000000e+00 1.136868e-13 -1.136868e-13 0.000000e+00
[6] -1.136868e-13 0.000000e+00 1.705303e-13 8.526513e-14 -8.526513e-14
[11] -5.684342e-14 -2.842171e-14 -5.684342e-14 2.842171e-14 1.136868e-13
[16] 0.000000e+00 0.000000e+00 -1.421085e-14 -7.105427e-14 -5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
9 13
9 19
9 20
1 8
6 9
3 12
1 19
4 8
2 6
4 15
4 13
3 13
10 15
1 18
2 18
5 20
4 13
9 10
4 15
7 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] 3.042833
> Min(tmp)
[1] -2.507316
> mean(tmp)
[1] 0.08010436
> Sum(tmp)
[1] 8.010436
> Var(tmp)
[1] 1.127075
>
> rowMeans(tmp)
[1] 0.08010436
> rowSums(tmp)
[1] 8.010436
> rowVars(tmp)
[1] 1.127075
> rowSd(tmp)
[1] 1.061638
> rowMax(tmp)
[1] 3.042833
> rowMin(tmp)
[1] -2.507316
>
> colMeans(tmp)
[1] 1.89960379 1.85153087 -2.39251012 2.80953595 -0.30334138 -0.56746373
[7] -1.13180868 -0.22840758 0.22212983 0.54227480 -0.23425266 -0.94432181
[13] -1.10626941 0.56077224 -0.81809872 -0.30831115 0.46747734 1.55915126
[19] 0.20775795 0.62616469 1.45176872 0.57548784 -0.77204331 -0.18745139
[25] 0.23044298 1.79032720 0.18149441 3.04283270 1.17692632 0.44826959
[31] 0.75815043 -1.32426987 -0.11331779 -0.55079867 1.25456476 0.41365939
[37] -0.21139637 0.47589218 0.61767542 0.96270830 -0.88160245 0.81816016
[43] 0.29467919 0.72486831 0.72380941 -1.10230902 -0.10781301 -0.63623916
[49] -1.81463203 -1.94462593 -0.09935021 -0.45942373 -0.95924327 0.24746335
[55] 1.04356424 1.02290661 0.54150162 -1.11036365 0.97617253 0.75988904
[61] 0.93564468 -0.06129990 0.46937081 -0.27424538 0.78363526 -2.50731614
[67] 1.05523844 0.58563499 2.17355234 -0.10408942 -0.51316450 0.37631573
[73] 0.77292727 0.17074340 -1.20019585 -1.05484558 -0.44844652 -0.46815294
[79] -0.39766120 1.94793059 -0.14698970 -1.78862194 -0.75976000 -0.75253771
[85] -0.21237197 -0.80492752 0.07194697 -0.22462060 0.10683545 -1.14482294
[91] -0.53885348 1.59526266 0.16191680 -0.99725312 -0.36684210 -0.61216809
[97] -0.55653780 2.23379738 -1.62016561 1.15562535
> colSums(tmp)
[1] 1.89960379 1.85153087 -2.39251012 2.80953595 -0.30334138 -0.56746373
[7] -1.13180868 -0.22840758 0.22212983 0.54227480 -0.23425266 -0.94432181
[13] -1.10626941 0.56077224 -0.81809872 -0.30831115 0.46747734 1.55915126
[19] 0.20775795 0.62616469 1.45176872 0.57548784 -0.77204331 -0.18745139
[25] 0.23044298 1.79032720 0.18149441 3.04283270 1.17692632 0.44826959
[31] 0.75815043 -1.32426987 -0.11331779 -0.55079867 1.25456476 0.41365939
[37] -0.21139637 0.47589218 0.61767542 0.96270830 -0.88160245 0.81816016
[43] 0.29467919 0.72486831 0.72380941 -1.10230902 -0.10781301 -0.63623916
[49] -1.81463203 -1.94462593 -0.09935021 -0.45942373 -0.95924327 0.24746335
[55] 1.04356424 1.02290661 0.54150162 -1.11036365 0.97617253 0.75988904
[61] 0.93564468 -0.06129990 0.46937081 -0.27424538 0.78363526 -2.50731614
[67] 1.05523844 0.58563499 2.17355234 -0.10408942 -0.51316450 0.37631573
[73] 0.77292727 0.17074340 -1.20019585 -1.05484558 -0.44844652 -0.46815294
[79] -0.39766120 1.94793059 -0.14698970 -1.78862194 -0.75976000 -0.75253771
[85] -0.21237197 -0.80492752 0.07194697 -0.22462060 0.10683545 -1.14482294
[91] -0.53885348 1.59526266 0.16191680 -0.99725312 -0.36684210 -0.61216809
[97] -0.55653780 2.23379738 -1.62016561 1.15562535
> 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] 1.89960379 1.85153087 -2.39251012 2.80953595 -0.30334138 -0.56746373
[7] -1.13180868 -0.22840758 0.22212983 0.54227480 -0.23425266 -0.94432181
[13] -1.10626941 0.56077224 -0.81809872 -0.30831115 0.46747734 1.55915126
[19] 0.20775795 0.62616469 1.45176872 0.57548784 -0.77204331 -0.18745139
[25] 0.23044298 1.79032720 0.18149441 3.04283270 1.17692632 0.44826959
[31] 0.75815043 -1.32426987 -0.11331779 -0.55079867 1.25456476 0.41365939
[37] -0.21139637 0.47589218 0.61767542 0.96270830 -0.88160245 0.81816016
[43] 0.29467919 0.72486831 0.72380941 -1.10230902 -0.10781301 -0.63623916
[49] -1.81463203 -1.94462593 -0.09935021 -0.45942373 -0.95924327 0.24746335
[55] 1.04356424 1.02290661 0.54150162 -1.11036365 0.97617253 0.75988904
[61] 0.93564468 -0.06129990 0.46937081 -0.27424538 0.78363526 -2.50731614
[67] 1.05523844 0.58563499 2.17355234 -0.10408942 -0.51316450 0.37631573
[73] 0.77292727 0.17074340 -1.20019585 -1.05484558 -0.44844652 -0.46815294
[79] -0.39766120 1.94793059 -0.14698970 -1.78862194 -0.75976000 -0.75253771
[85] -0.21237197 -0.80492752 0.07194697 -0.22462060 0.10683545 -1.14482294
[91] -0.53885348 1.59526266 0.16191680 -0.99725312 -0.36684210 -0.61216809
[97] -0.55653780 2.23379738 -1.62016561 1.15562535
> colMin(tmp)
[1] 1.89960379 1.85153087 -2.39251012 2.80953595 -0.30334138 -0.56746373
[7] -1.13180868 -0.22840758 0.22212983 0.54227480 -0.23425266 -0.94432181
[13] -1.10626941 0.56077224 -0.81809872 -0.30831115 0.46747734 1.55915126
[19] 0.20775795 0.62616469 1.45176872 0.57548784 -0.77204331 -0.18745139
[25] 0.23044298 1.79032720 0.18149441 3.04283270 1.17692632 0.44826959
[31] 0.75815043 -1.32426987 -0.11331779 -0.55079867 1.25456476 0.41365939
[37] -0.21139637 0.47589218 0.61767542 0.96270830 -0.88160245 0.81816016
[43] 0.29467919 0.72486831 0.72380941 -1.10230902 -0.10781301 -0.63623916
[49] -1.81463203 -1.94462593 -0.09935021 -0.45942373 -0.95924327 0.24746335
[55] 1.04356424 1.02290661 0.54150162 -1.11036365 0.97617253 0.75988904
[61] 0.93564468 -0.06129990 0.46937081 -0.27424538 0.78363526 -2.50731614
[67] 1.05523844 0.58563499 2.17355234 -0.10408942 -0.51316450 0.37631573
[73] 0.77292727 0.17074340 -1.20019585 -1.05484558 -0.44844652 -0.46815294
[79] -0.39766120 1.94793059 -0.14698970 -1.78862194 -0.75976000 -0.75253771
[85] -0.21237197 -0.80492752 0.07194697 -0.22462060 0.10683545 -1.14482294
[91] -0.53885348 1.59526266 0.16191680 -0.99725312 -0.36684210 -0.61216809
[97] -0.55653780 2.23379738 -1.62016561 1.15562535
> colMedians(tmp)
[1] 1.89960379 1.85153087 -2.39251012 2.80953595 -0.30334138 -0.56746373
[7] -1.13180868 -0.22840758 0.22212983 0.54227480 -0.23425266 -0.94432181
[13] -1.10626941 0.56077224 -0.81809872 -0.30831115 0.46747734 1.55915126
[19] 0.20775795 0.62616469 1.45176872 0.57548784 -0.77204331 -0.18745139
[25] 0.23044298 1.79032720 0.18149441 3.04283270 1.17692632 0.44826959
[31] 0.75815043 -1.32426987 -0.11331779 -0.55079867 1.25456476 0.41365939
[37] -0.21139637 0.47589218 0.61767542 0.96270830 -0.88160245 0.81816016
[43] 0.29467919 0.72486831 0.72380941 -1.10230902 -0.10781301 -0.63623916
[49] -1.81463203 -1.94462593 -0.09935021 -0.45942373 -0.95924327 0.24746335
[55] 1.04356424 1.02290661 0.54150162 -1.11036365 0.97617253 0.75988904
[61] 0.93564468 -0.06129990 0.46937081 -0.27424538 0.78363526 -2.50731614
[67] 1.05523844 0.58563499 2.17355234 -0.10408942 -0.51316450 0.37631573
[73] 0.77292727 0.17074340 -1.20019585 -1.05484558 -0.44844652 -0.46815294
[79] -0.39766120 1.94793059 -0.14698970 -1.78862194 -0.75976000 -0.75253771
[85] -0.21237197 -0.80492752 0.07194697 -0.22462060 0.10683545 -1.14482294
[91] -0.53885348 1.59526266 0.16191680 -0.99725312 -0.36684210 -0.61216809
[97] -0.55653780 2.23379738 -1.62016561 1.15562535
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.899604 1.851531 -2.39251 2.809536 -0.3033414 -0.5674637 -1.131809
[2,] 1.899604 1.851531 -2.39251 2.809536 -0.3033414 -0.5674637 -1.131809
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.2284076 0.2221298 0.5422748 -0.2342527 -0.9443218 -1.106269 0.5607722
[2,] -0.2284076 0.2221298 0.5422748 -0.2342527 -0.9443218 -1.106269 0.5607722
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.8180987 -0.3083112 0.4674773 1.559151 0.207758 0.6261647 1.451769
[2,] -0.8180987 -0.3083112 0.4674773 1.559151 0.207758 0.6261647 1.451769
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.5754878 -0.7720433 -0.1874514 0.230443 1.790327 0.1814944 3.042833
[2,] 0.5754878 -0.7720433 -0.1874514 0.230443 1.790327 0.1814944 3.042833
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.176926 0.4482696 0.7581504 -1.32427 -0.1133178 -0.5507987 1.254565
[2,] 1.176926 0.4482696 0.7581504 -1.32427 -0.1133178 -0.5507987 1.254565
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.4136594 -0.2113964 0.4758922 0.6176754 0.9627083 -0.8816024 0.8181602
[2,] 0.4136594 -0.2113964 0.4758922 0.6176754 0.9627083 -0.8816024 0.8181602
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.2946792 0.7248683 0.7238094 -1.102309 -0.107813 -0.6362392 -1.814632
[2,] 0.2946792 0.7248683 0.7238094 -1.102309 -0.107813 -0.6362392 -1.814632
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.944626 -0.09935021 -0.4594237 -0.9592433 0.2474634 1.043564 1.022907
[2,] -1.944626 -0.09935021 -0.4594237 -0.9592433 0.2474634 1.043564 1.022907
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.5415016 -1.110364 0.9761725 0.759889 0.9356447 -0.0612999 0.4693708
[2,] 0.5415016 -1.110364 0.9761725 0.759889 0.9356447 -0.0612999 0.4693708
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.2742454 0.7836353 -2.507316 1.055238 0.585635 2.173552 -0.1040894
[2,] -0.2742454 0.7836353 -2.507316 1.055238 0.585635 2.173552 -0.1040894
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.5131645 0.3763157 0.7729273 0.1707434 -1.200196 -1.054846 -0.4484465
[2,] -0.5131645 0.3763157 0.7729273 0.1707434 -1.200196 -1.054846 -0.4484465
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.4681529 -0.3976612 1.947931 -0.1469897 -1.788622 -0.75976 -0.7525377
[2,] -0.4681529 -0.3976612 1.947931 -0.1469897 -1.788622 -0.75976 -0.7525377
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.212372 -0.8049275 0.07194697 -0.2246206 0.1068354 -1.144823 -0.5388535
[2,] -0.212372 -0.8049275 0.07194697 -0.2246206 0.1068354 -1.144823 -0.5388535
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.595263 0.1619168 -0.9972531 -0.3668421 -0.6121681 -0.5565378 2.233797
[2,] 1.595263 0.1619168 -0.9972531 -0.3668421 -0.6121681 -0.5565378 2.233797
[,99] [,100]
[1,] -1.620166 1.155625
[2,] -1.620166 1.155625
>
>
> Max(tmp2)
[1] 1.84328
> Min(tmp2)
[1] -2.187789
> mean(tmp2)
[1] 0.06395077
> Sum(tmp2)
[1] 6.395077
> Var(tmp2)
[1] 0.6776008
>
> rowMeans(tmp2)
[1] -0.186664579 0.405184401 0.128952284 -0.311023319 0.490822209
[6] -0.561570313 -0.362315874 0.400245432 0.537161432 -0.105782908
[11] -1.652161872 0.801495272 1.502533019 -1.081223839 0.840782986
[16] 0.115006638 0.597491650 0.359466264 0.660524772 -0.009213089
[21] -0.530580338 1.474102730 0.021303105 0.056931281 -0.104294328
[26] -0.451985621 0.430008644 0.787492884 0.236810282 0.916865108
[31] 0.178833330 -1.481160721 -2.187789339 1.057026737 0.719528412
[36] -0.135792517 -0.286839923 1.710781836 0.208387356 -0.372431963
[41] -0.180582182 -1.119989068 1.455397857 -0.073757099 -1.044503950
[46] -0.549994912 -0.684771056 -0.803212574 -0.999152345 -0.218781105
[51] 0.979857213 -0.579604057 -0.116884675 -1.017727946 0.576356512
[56] 0.410602644 1.301357773 0.201004388 1.843280096 -0.978891924
[61] -0.452806564 -0.288967659 0.243716907 -0.930416638 0.705386616
[66] 0.829202473 -0.771885612 0.965301924 0.537895021 0.685475067
[71] -1.494667891 0.345994311 -0.365524368 0.431481980 0.298670124
[76] -1.092801755 -0.725267193 1.296451935 0.950521923 0.530404806
[81] -0.707753618 -0.162294726 0.851068488 -0.384547307 1.171049101
[86] 0.301982112 0.571966439 -0.787322934 1.288791225 -0.810507386
[91] 0.121523108 0.575405138 0.526769478 0.102106411 -0.087259919
[96] 0.364767930 -1.089374890 -1.942749605 0.389003947 1.187377774
> rowSums(tmp2)
[1] -0.186664579 0.405184401 0.128952284 -0.311023319 0.490822209
[6] -0.561570313 -0.362315874 0.400245432 0.537161432 -0.105782908
[11] -1.652161872 0.801495272 1.502533019 -1.081223839 0.840782986
[16] 0.115006638 0.597491650 0.359466264 0.660524772 -0.009213089
[21] -0.530580338 1.474102730 0.021303105 0.056931281 -0.104294328
[26] -0.451985621 0.430008644 0.787492884 0.236810282 0.916865108
[31] 0.178833330 -1.481160721 -2.187789339 1.057026737 0.719528412
[36] -0.135792517 -0.286839923 1.710781836 0.208387356 -0.372431963
[41] -0.180582182 -1.119989068 1.455397857 -0.073757099 -1.044503950
[46] -0.549994912 -0.684771056 -0.803212574 -0.999152345 -0.218781105
[51] 0.979857213 -0.579604057 -0.116884675 -1.017727946 0.576356512
[56] 0.410602644 1.301357773 0.201004388 1.843280096 -0.978891924
[61] -0.452806564 -0.288967659 0.243716907 -0.930416638 0.705386616
[66] 0.829202473 -0.771885612 0.965301924 0.537895021 0.685475067
[71] -1.494667891 0.345994311 -0.365524368 0.431481980 0.298670124
[76] -1.092801755 -0.725267193 1.296451935 0.950521923 0.530404806
[81] -0.707753618 -0.162294726 0.851068488 -0.384547307 1.171049101
[86] 0.301982112 0.571966439 -0.787322934 1.288791225 -0.810507386
[91] 0.121523108 0.575405138 0.526769478 0.102106411 -0.087259919
[96] 0.364767930 -1.089374890 -1.942749605 0.389003947 1.187377774
> 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.186664579 0.405184401 0.128952284 -0.311023319 0.490822209
[6] -0.561570313 -0.362315874 0.400245432 0.537161432 -0.105782908
[11] -1.652161872 0.801495272 1.502533019 -1.081223839 0.840782986
[16] 0.115006638 0.597491650 0.359466264 0.660524772 -0.009213089
[21] -0.530580338 1.474102730 0.021303105 0.056931281 -0.104294328
[26] -0.451985621 0.430008644 0.787492884 0.236810282 0.916865108
[31] 0.178833330 -1.481160721 -2.187789339 1.057026737 0.719528412
[36] -0.135792517 -0.286839923 1.710781836 0.208387356 -0.372431963
[41] -0.180582182 -1.119989068 1.455397857 -0.073757099 -1.044503950
[46] -0.549994912 -0.684771056 -0.803212574 -0.999152345 -0.218781105
[51] 0.979857213 -0.579604057 -0.116884675 -1.017727946 0.576356512
[56] 0.410602644 1.301357773 0.201004388 1.843280096 -0.978891924
[61] -0.452806564 -0.288967659 0.243716907 -0.930416638 0.705386616
[66] 0.829202473 -0.771885612 0.965301924 0.537895021 0.685475067
[71] -1.494667891 0.345994311 -0.365524368 0.431481980 0.298670124
[76] -1.092801755 -0.725267193 1.296451935 0.950521923 0.530404806
[81] -0.707753618 -0.162294726 0.851068488 -0.384547307 1.171049101
[86] 0.301982112 0.571966439 -0.787322934 1.288791225 -0.810507386
[91] 0.121523108 0.575405138 0.526769478 0.102106411 -0.087259919
[96] 0.364767930 -1.089374890 -1.942749605 0.389003947 1.187377774
> rowMin(tmp2)
[1] -0.186664579 0.405184401 0.128952284 -0.311023319 0.490822209
[6] -0.561570313 -0.362315874 0.400245432 0.537161432 -0.105782908
[11] -1.652161872 0.801495272 1.502533019 -1.081223839 0.840782986
[16] 0.115006638 0.597491650 0.359466264 0.660524772 -0.009213089
[21] -0.530580338 1.474102730 0.021303105 0.056931281 -0.104294328
[26] -0.451985621 0.430008644 0.787492884 0.236810282 0.916865108
[31] 0.178833330 -1.481160721 -2.187789339 1.057026737 0.719528412
[36] -0.135792517 -0.286839923 1.710781836 0.208387356 -0.372431963
[41] -0.180582182 -1.119989068 1.455397857 -0.073757099 -1.044503950
[46] -0.549994912 -0.684771056 -0.803212574 -0.999152345 -0.218781105
[51] 0.979857213 -0.579604057 -0.116884675 -1.017727946 0.576356512
[56] 0.410602644 1.301357773 0.201004388 1.843280096 -0.978891924
[61] -0.452806564 -0.288967659 0.243716907 -0.930416638 0.705386616
[66] 0.829202473 -0.771885612 0.965301924 0.537895021 0.685475067
[71] -1.494667891 0.345994311 -0.365524368 0.431481980 0.298670124
[76] -1.092801755 -0.725267193 1.296451935 0.950521923 0.530404806
[81] -0.707753618 -0.162294726 0.851068488 -0.384547307 1.171049101
[86] 0.301982112 0.571966439 -0.787322934 1.288791225 -0.810507386
[91] 0.121523108 0.575405138 0.526769478 0.102106411 -0.087259919
[96] 0.364767930 -1.089374890 -1.942749605 0.389003947 1.187377774
>
> colMeans(tmp2)
[1] 0.06395077
> colSums(tmp2)
[1] 6.395077
> colVars(tmp2)
[1] 0.6776008
> colSd(tmp2)
[1] 0.8231651
> colMax(tmp2)
[1] 1.84328
> colMin(tmp2)
[1] -2.187789
> colMedians(tmp2)
[1] 0.1252377
> colRanges(tmp2)
[,1]
[1,] -2.187789
[2,] 1.843280
>
> 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.5124351 -0.1017810 0.5417989 -1.8490749 2.9636780 -5.4534001
[7] -2.3107792 -2.5500406 2.0812993 2.3282757
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.2610594
[2,] -0.1457402
[3,] 0.2171227
[4,] 0.4958255
[5,] 1.3981706
>
> rowApply(tmp,sum)
[1] 3.855890 0.154832 -2.041060 -2.836395 6.116775 -3.700777 -4.090837
[8] -1.710844 -4.046476 4.461304
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 4 10 4 5 6 1 8 8 6
[2,] 10 10 4 1 4 2 2 3 7 9
[3,] 4 6 9 6 2 8 7 7 3 4
[4,] 3 5 5 8 1 3 9 10 10 1
[5,] 5 1 7 9 10 1 10 9 4 10
[6,] 2 3 6 2 8 4 5 1 1 8
[7,] 1 7 1 7 6 7 6 4 5 7
[8,] 8 9 3 5 3 5 4 5 2 3
[9,] 7 8 2 10 7 9 3 6 9 2
[10,] 9 2 8 3 9 10 8 2 6 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.9805493 -0.6577649 -3.3591105 0.3833986 0.9437109 1.0550333
[7] -1.3324222 -1.6530877 -0.8232229 0.2413965 1.0532805 -1.5427081
[13] 0.1413831 0.1191442 1.7531763 2.6537286 -2.1124729 -0.2340407
[19] 0.8286303 0.9106145
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8699199
[2,] -1.1859620
[3,] 0.1847658
[4,] 0.4270290
[5,] 0.4635378
>
> rowApply(tmp,sum)
[1] -4.6943716 7.4856452 -4.4841566 -2.1017034 0.1827039
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 16 2 13 1 14
[2,] 11 8 16 3 13
[3,] 5 1 5 16 11
[4,] 18 20 3 8 7
[5,] 9 16 10 13 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.4270290 -0.3781654 -1.01685781 0.7697904 -0.4628344 1.0435224
[2,] -1.1859620 0.4222793 -2.11140117 2.0168605 0.9804759 1.4153646
[3,] 0.1847658 0.3976485 -1.11470005 -1.4483421 -0.1353518 -0.9215140
[4,] -1.8699199 -1.4270996 0.81706411 -0.3770050 0.7048858 0.7597485
[5,] 0.4635378 0.3275722 0.06678441 -0.5779050 -0.1434645 -1.2420882
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.9039734 -1.1749008 -1.0406116 -1.3835725 -0.3789519 -0.7755291
[2,] 0.8651596 0.8289775 -0.9356314 1.1853939 0.9099737 0.8356238
[3,] -0.3444235 0.2805663 -0.8974781 0.3986034 -0.2495686 -1.8507078
[4,] -1.0730533 -0.8609856 0.7100579 0.9951752 -0.4874330 -0.3407323
[5,] 0.1238684 -0.7267452 1.3404403 -0.9542035 1.2592604 0.5886374
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.36275623 -0.2480716 1.5704061 0.32166802 -1.2616666 0.5513435
[2,] -0.80971662 0.2020840 0.7333345 -0.01219195 0.4802748 -0.1298864
[3,] 0.79816982 0.2570085 -1.1889643 1.57294942 -1.7073958 1.6849934
[4,] -0.02387667 0.8456530 1.0511039 -0.17904762 -0.7143427 -1.7311887
[5,] -0.18594967 -0.9375297 -0.4127041 0.95035076 1.0906574 -0.6093025
[,19] [,20]
[1,] -0.5009480 -0.21480403
[2,] 1.0261263 0.76850653
[3,] -0.1246039 -0.07581174
[4,] 1.1401225 -0.04082996
[5,] -0.7120666 0.47355369
>
>
> 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 : 655 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.5101166 -1.098772 -1.507281 -0.1326013 0.005558039 1.22212 -1.243399
col8 col9 col10 col11 col12 col13 col14
row1 -0.5639933 0.9902011 0.1960239 2.279424 0.1591512 -0.4431521 0.4685042
col15 col16 col17 col18 col19 col20
row1 0.01693392 -0.5743542 0.2209324 -0.8535452 -0.1594831 1.549268
> tmp[,"col10"]
col10
row1 0.19602392
row2 0.40174573
row3 0.13814418
row4 0.05757175
row5 0.29029771
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.5101166 -1.0987723 -1.5072810 -0.1326013 0.005558039 1.222120 -1.243399
row5 -2.3341944 -0.3873603 0.4085054 -0.2592406 0.884683601 1.321187 1.331588
col8 col9 col10 col11 col12 col13 col14
row1 -0.5639933 0.9902011 0.1960239 2.279424 0.1591512 -0.4431521 0.4685042
row5 0.6159126 0.6833925 0.2902977 0.134663 -0.8729262 -0.6445356 -0.3987523
col15 col16 col17 col18 col19 col20
row1 0.01693392 -0.5743542 0.2209324 -0.8535452 -0.1594831 1.5492678
row5 -0.28096203 2.5406823 -0.4345645 1.0284171 -0.1260072 0.4300907
> tmp[,c("col6","col20")]
col6 col20
row1 1.2221197 1.5492678
row2 -0.4090533 0.5288820
row3 1.3190236 0.9191833
row4 0.2814979 -1.3089969
row5 1.3211868 0.4300907
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.222120 1.5492678
row5 1.321187 0.4300907
>
>
>
>
> 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.60553 51.64934 50.59057 50.96549 49.95722 105.0996 50.68719 49.93486
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.23334 51.10363 49.87763 51.10426 49.51448 50.17492 50.34966 49.18732
col17 col18 col19 col20
row1 50.81552 51.73505 49.28614 105.2348
> tmp[,"col10"]
col10
row1 51.10363
row2 30.57666
row3 29.28762
row4 29.82976
row5 50.74328
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.60553 51.64934 50.59057 50.96549 49.95722 105.0996 50.68719 49.93486
row5 51.16689 51.41142 49.91125 50.87483 50.04040 104.5749 50.09547 49.40061
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.23334 51.10363 49.87763 51.10426 49.51448 50.17492 50.34966 49.18732
row5 49.99103 50.74328 50.95753 50.89113 49.73187 51.15190 48.65237 48.39844
col17 col18 col19 col20
row1 50.81552 51.73505 49.28614 105.2348
row5 48.57182 49.46608 51.28223 107.5599
> tmp[,c("col6","col20")]
col6 col20
row1 105.09959 105.23476
row2 74.64079 73.65765
row3 75.06439 75.22901
row4 74.81302 75.23828
row5 104.57486 107.55991
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.0996 105.2348
row5 104.5749 107.5599
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.0996 105.2348
row5 104.5749 107.5599
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.48864748
[2,] -0.12977597
[3,] 0.04425567
[4,] 0.24056387
[5,] 0.03397476
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.8438562 -1.0533381
[2,] 0.6094337 0.3552797
[3,] -0.2016081 0.3025847
[4,] 1.8128480 0.2711269
[5,] 0.4120025 -0.4728810
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.11714643 0.61693312
[2,] 0.07030504 0.04626745
[3,] 0.40588718 0.47634299
[4,] 0.31677490 1.51357904
[5,] 0.31187773 0.93128212
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.1171464
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.11714643
[2,] 0.07030504
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.9708671 0.5436088 0.8283588 0.7793722 -0.3983023 -1.141829 -2.0147392
row1 1.1175735 -0.5187973 -1.1886954 -0.2550876 -0.6522151 1.470621 0.8021689
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -1.5046472 -1.0063570 2.5953956 0.9704633 1.0730387 -1.53987277
row1 0.9453704 -0.4839728 0.1905187 -1.0395719 0.1113733 -0.02651968
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.2883817 1.398347 -0.6528419 -0.7158827 1.120679 -0.6840547 0.85865401
row1 0.5094744 1.034946 1.8093864 -1.4433385 -0.912334 -0.5010256 -0.07685196
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.4548367 -0.9994863 -1.023839 2.271335 0.3312836 1.025245 1.307143
[,8] [,9] [,10]
row2 0.5388739 0.4942655 1.675403
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.747823 -0.1150014 -0.3697936 2.114955 -1.435021 -2.535787 0.8470909
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.583797 -1.917698 -0.4686886 1.352684 1.576207 -0.5060781 -0.4785907
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.5313466 0.7343511 -0.2202301 0.08111387 1.236972 -0.4106028
>
>
> 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: 0x600003d10360>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a24794af914"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a242926ce42"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2432af6429"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2418d8d9be"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2444bf55b0"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a246d92b912"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a243bb484f1"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a24488408d6"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2454603ecb"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a247abaacb3"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2475a05ab7"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2472a3e0b5"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a2464f5c5df"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a244391e741"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12a241fe57f0f"
>
>
> ### 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: 0x600003d484e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003d484e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003d484e0>
> rowMedians(tmp)
[1] 0.402472073 0.084838828 0.463055887 -0.153850718 0.279383930
[6] -0.321768317 0.181996097 -0.142444666 0.894656411 -0.544295349
[11] -0.232304584 -0.571494492 -0.175517361 -0.102435247 -0.230616953
[16] 0.135563291 -0.314536610 0.192091594 0.520463845 -0.129951433
[21] -0.192249355 -0.196428241 -0.385476648 0.857974592 0.430676033
[26] 0.433051162 0.378425474 0.260524697 0.123174179 0.597382476
[31] 0.128749441 -0.336598726 0.261038392 -0.243256890 0.116008972
[36] 0.046090132 0.318067632 0.551644765 -0.347402162 -0.329027210
[41] -0.161004910 0.001978195 0.142864048 0.331238343 -0.130089468
[46] -0.117435583 0.521376657 0.155704333 0.077655375 0.259379309
[51] 0.284942471 -0.271114424 -0.129878944 -0.128268491 -0.500124326
[56] -0.366551862 0.104840898 0.081848705 0.162638749 0.119687931
[61] 0.203169501 0.091735320 -0.455138432 -0.308678323 -0.099570021
[66] -0.069293739 -0.222537075 -0.009981559 0.054835961 -0.583993243
[71] -0.155833259 0.524520244 0.132855989 -0.121315327 0.236172533
[76] 0.505443898 -0.051415185 0.176996319 0.015459438 0.086929680
[81] -0.422705689 0.504923305 -0.322690526 0.152301238 0.080331087
[86] 0.527792608 -0.138844810 0.005674533 0.371772753 -0.013308725
[91] 0.475950462 -0.036188123 0.321654640 -0.007983054 -0.239943387
[96] -0.101957640 -0.044130244 0.282620602 0.559723441 0.137986362
[101] 0.116266751 0.481286378 -0.088779367 0.383267647 0.046004677
[106] -0.086411964 0.181431281 0.223315200 -0.238551434 0.246397078
[111] 0.456287562 0.058454236 0.757885324 -0.142962877 -0.098595824
[116] 0.326951148 0.257837059 0.207120811 -0.172161867 0.274734732
[121] -0.055727232 -0.206810997 0.413072236 -0.255587619 0.034940298
[126] -0.340610428 0.161603775 -0.033462802 0.580066812 -0.383605699
[131] 0.387894822 0.046010015 0.291989283 0.046663861 -0.113083575
[136] -0.190445411 -0.191661156 0.482871878 0.463668036 -0.192491646
[141] 0.111976101 0.362538142 -0.337039260 -0.263917993 0.203138115
[146] -0.360679917 -0.190343355 0.091021309 -0.255662338 0.146714101
[151] -0.046250624 0.094315154 -0.359107002 -0.286917631 0.258529062
[156] -0.392794717 -0.384745181 0.197416092 -0.289007978 0.171313645
[161] 0.097082922 0.120661861 0.037013076 0.102914114 -0.299541565
[166] 0.149458885 -0.231928725 -0.124289523 -0.483775923 -0.576234385
[171] -0.213454822 0.151159830 -0.658272310 -0.212291928 -0.055581220
[176] -0.016190982 -0.370117041 -0.434013685 0.072257625 -0.242440032
[181] -0.378080600 -0.365784054 -0.305121664 0.001140073 0.044773275
[186] -0.652290403 -0.452136246 -0.347187642 0.296190907 0.041887834
[191] 0.311535556 0.131469551 0.483386032 0.242014784 0.580526453
[196] 0.161827326 0.076965641 -0.057825858 -0.098254967 0.249165259
[201] -0.330795526 -0.795615883 -0.634402336 -0.082220024 -0.108233678
[206] -0.139953802 0.487028387 0.193841371 0.277265466 0.019514638
[211] -0.244867759 -0.340659737 -0.063709395 0.049113753 -0.049215666
[216] 0.377034448 0.118716347 -0.440997470 -0.105916718 0.519078003
[221] 0.035675896 0.249201559 -0.407744748 0.401048411 -0.996520839
[226] -0.387453453 0.114530437 -0.318723509 -0.250055294 -0.190863160
>
> proc.time()
user system elapsed
0.730 3.505 4.912
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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: 0x6000022e4120>
> .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: 0x6000022e4120>
> .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: 0x6000022e4120>
> .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: 0x6000022e4120>
> 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: 0x6000022e4a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e4a20>
> .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: 0x6000022e4a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e4a20>
> .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: 0x6000022e4a20>
> 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: 0x6000022e4c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e4c00>
> .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: 0x6000022e4c00>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000022e4c00>
> .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: 0x6000022e4c00>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022e4c00>
> .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: 0x6000022e4c00>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022e4c00>
> .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: 0x6000022e4c00>
> 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: 0x6000022e4de0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000022e4de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e4de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e4de0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12d7d2c02428a" "BufferedMatrixFile12d7d485e8898"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12d7d2c02428a" "BufferedMatrixFile12d7d485e8898"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e5080>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e5080>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022e5080>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022e5080>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022e5080>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022e5080>
> .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: 0x6000022e5260>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022e5260>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000022e5260>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000022e5260>
> 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: 0x6000022e5440>
> .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: 0x6000022e5440>
> rm(P)
>
> proc.time()
user system elapsed
0.129 0.051 0.183
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.156 0.042 0.191