| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-25 11:35 -0400 (Sat, 25 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4978 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-04-08 r89818) | 4722 |
| 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 262/2415 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
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-04-24 18:46:22 -0400 (Fri, 24 Apr 2026) |
| EndedAt: 2026-04-24 18:46:41 -0400 (Fri, 24 Apr 2026) |
| EllapsedTime: 19.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 version 4.6.0 alpha (2026-04-08 r89818)
* using platform: aarch64-apple-darwin23
* R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
* running under: macOS Tahoe 26.3.1
* using session charset: UTF-8
* current time: 2026-04-24 22:46:22 UTC
* 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 17.0.0 (clang-1700.6.4.2)’
* used SDK: ‘MacOSX26.2.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/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’
using SDK: ‘MacOSX26.2.sdk’
clang -arch arm64 -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 -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]
1580 | if (!(Matrix->readonly) & setting){
| ^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
1580 | if (!(Matrix->readonly) & setting){
| ^
| ( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
2 warnings generated.
clang -arch arm64 -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 -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 -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/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.115 0.046 0.156
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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 484141 25.9 1067251 57 NA 632017 33.8
Vcells 896965 6.9 8388608 64 196608 2112089 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 Apr 24 18:46:32 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] "Fri Apr 24 18:46:32 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: 0x10149f130>
>
>
>
> 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 Apr 24 18:46:34 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] "Fri Apr 24 18:46:34 2026"
>
> ColMode(tmp2)
<pointer: 0x10149f130>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.7172787 -0.5230862 0.05679584 0.8794399
[2,] 0.0525865 -0.2600873 -0.58963560 -0.1172075
[3,] 0.7937900 -0.1051789 -0.40435890 -1.6887630
[4,] 0.6363188 0.7446739 0.06664249 0.6879387
> 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,] 100.7172787 0.5230862 0.05679584 0.8794399
[2,] 0.0525865 0.2600873 0.58963560 0.1172075
[3,] 0.7937900 0.1051789 0.40435890 1.6887630
[4,] 0.6363188 0.7446739 0.06664249 0.6879387
> 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,] 10.0357999 0.7232470 0.2383188 0.9377845
[2,] 0.2293175 0.5099876 0.7678773 0.3423558
[3,] 0.8909489 0.3243130 0.6358922 1.2995241
[4,] 0.7976959 0.8629449 0.2581521 0.8294207
>
> 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,] 226.07528 32.75556 27.43998 35.25729
[2,] 27.34576 30.35996 33.26841 28.54077
[3,] 34.70328 28.34831 31.76328 39.68400
[4,] 33.61328 34.37412 27.64816 33.98215
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xc3f1a4000>
> exp(tmp5)
<pointer: 0xc3f1a4000>
> log(tmp5,2)
<pointer: 0xc3f1a4000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.5461
> Min(tmp5)
[1] 52.28298
> mean(tmp5)
[1] 72.58954
> Sum(tmp5)
[1] 14517.91
> Var(tmp5)
[1] 878.5888
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.15276 70.78728 70.69584 70.38733 70.68386 71.65677 72.21237 70.90119
[9] 71.33716 68.08083
> rowSums(tmp5)
[1] 1783.055 1415.746 1413.917 1407.747 1413.677 1433.135 1444.247 1418.024
[9] 1426.743 1361.617
> rowVars(tmp5)
[1] 8129.26061 95.39635 43.82923 56.31381 104.19443 129.70346
[7] 62.29614 71.36406 97.37098 80.31650
> rowSd(tmp5)
[1] 90.162412 9.767105 6.620365 7.504253 10.207567 11.388743 7.892790
[8] 8.447725 9.867674 8.961947
> rowMax(tmp5)
[1] 470.54607 84.89745 82.59706 83.76260 94.20310 93.42946 83.91480
[8] 90.90478 85.12633 83.34175
> rowMin(tmp5)
[1] 56.25916 56.59757 57.69407 57.54603 56.35654 55.04907 58.34852 57.67035
[9] 54.97442 52.28298
>
> colMeans(tmp5)
[1] 106.80474 65.58414 66.09179 71.55840 71.96713 67.62565 73.12510
[8] 70.08972 70.84638 71.78116 75.09183 68.40302 68.06473 76.57008
[15] 69.85845 69.51669 73.02756 67.30717 72.90691 75.57013
> colSums(tmp5)
[1] 1068.0474 655.8414 660.9179 715.5840 719.6713 676.2565 731.2510
[8] 700.8972 708.4638 717.8116 750.9183 684.0302 680.6473 765.7008
[15] 698.5845 695.1669 730.2756 673.0717 729.0691 755.7013
> colVars(tmp5)
[1] 16401.83317 73.93268 94.34114 93.89819 41.31412 72.00777
[7] 61.74676 53.30214 34.46668 98.75676 125.67840 83.55060
[13] 33.77236 64.05426 49.75931 115.05674 146.96489 92.15557
[19] 69.87982 50.78914
> colSd(tmp5)
[1] 128.069642 8.598411 9.712937 9.690108 6.427606 8.485739
[7] 7.857911 7.300831 5.870833 9.937644 11.210638 9.140602
[13] 5.811399 8.003391 7.054028 10.726450 12.122908 9.599769
[19] 8.359415 7.126650
> colMax(tmp5)
[1] 470.54607 81.40943 81.19519 83.91480 79.36667 83.38747 83.76260
[8] 81.43705 80.73061 85.12633 90.71728 90.90478 81.24159 94.20310
[15] 80.10613 83.68661 93.42946 83.28686 84.89745 83.23596
> colMin(tmp5)
[1] 56.46076 56.81992 52.28298 57.16315 62.24277 54.97442 61.30233 60.70808
[9] 63.84281 57.50538 57.87085 57.49652 60.20221 65.90507 61.11185 56.35654
[17] 57.69407 56.08076 55.04907 63.77572
>
>
> ### 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] 89.15276 70.78728 70.69584 70.38733 70.68386 71.65677 72.21237 70.90119
[9] 71.33716 NA
> rowSums(tmp5)
[1] 1783.055 1415.746 1413.917 1407.747 1413.677 1433.135 1444.247 1418.024
[9] 1426.743 NA
> rowVars(tmp5)
[1] 8129.26061 95.39635 43.82923 56.31381 104.19443 129.70346
[7] 62.29614 71.36406 97.37098 81.85704
> rowSd(tmp5)
[1] 90.162412 9.767105 6.620365 7.504253 10.207567 11.388743 7.892790
[8] 8.447725 9.867674 9.047488
> rowMax(tmp5)
[1] 470.54607 84.89745 82.59706 83.76260 94.20310 93.42946 83.91480
[8] 90.90478 85.12633 NA
> rowMin(tmp5)
[1] 56.25916 56.59757 57.69407 57.54603 56.35654 55.04907 58.34852 57.67035
[9] 54.97442 NA
>
> colMeans(tmp5)
[1] 106.80474 65.58414 66.09179 71.55840 71.96713 67.62565 73.12510
[8] 70.08972 70.84638 71.78116 75.09183 68.40302 68.06473 76.57008
[15] 69.85845 69.51669 73.02756 67.30717 NA 75.57013
> colSums(tmp5)
[1] 1068.0474 655.8414 660.9179 715.5840 719.6713 676.2565 731.2510
[8] 700.8972 708.4638 717.8116 750.9183 684.0302 680.6473 765.7008
[15] 698.5845 695.1669 730.2756 673.0717 NA 755.7013
> colVars(tmp5)
[1] 16401.83317 73.93268 94.34114 93.89819 41.31412 72.00777
[7] 61.74676 53.30214 34.46668 98.75676 125.67840 83.55060
[13] 33.77236 64.05426 49.75931 115.05674 146.96489 92.15557
[19] NA 50.78914
> colSd(tmp5)
[1] 128.069642 8.598411 9.712937 9.690108 6.427606 8.485739
[7] 7.857911 7.300831 5.870833 9.937644 11.210638 9.140602
[13] 5.811399 8.003391 7.054028 10.726450 12.122908 9.599769
[19] NA 7.126650
> colMax(tmp5)
[1] 470.54607 81.40943 81.19519 83.91480 79.36667 83.38747 83.76260
[8] 81.43705 80.73061 85.12633 90.71728 90.90478 81.24159 94.20310
[15] 80.10613 83.68661 93.42946 83.28686 NA 83.23596
> colMin(tmp5)
[1] 56.46076 56.81992 52.28298 57.16315 62.24277 54.97442 61.30233 60.70808
[9] 63.84281 57.50538 57.87085 57.49652 60.20221 65.90507 61.11185 56.35654
[17] 57.69407 56.08076 NA 63.77572
>
> Max(tmp5,na.rm=TRUE)
[1] 470.5461
> Min(tmp5,na.rm=TRUE)
[1] 52.28298
> mean(tmp5,na.rm=TRUE)
[1] 72.57668
> Sum(tmp5,na.rm=TRUE)
[1] 14442.76
> Var(tmp5,na.rm=TRUE)
[1] 882.9929
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.15276 70.78728 70.69584 70.38733 70.68386 71.65677 72.21237 70.90119
[9] 71.33716 67.70883
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.055 1415.746 1413.917 1407.747 1413.677 1433.135 1444.247 1418.024
[9] 1426.743 1286.468
> rowVars(tmp5,na.rm=TRUE)
[1] 8129.26061 95.39635 43.82923 56.31381 104.19443 129.70346
[7] 62.29614 71.36406 97.37098 81.85704
> rowSd(tmp5,na.rm=TRUE)
[1] 90.162412 9.767105 6.620365 7.504253 10.207567 11.388743 7.892790
[8] 8.447725 9.867674 9.047488
> rowMax(tmp5,na.rm=TRUE)
[1] 470.54607 84.89745 82.59706 83.76260 94.20310 93.42946 83.91480
[8] 90.90478 85.12633 83.34175
> rowMin(tmp5,na.rm=TRUE)
[1] 56.25916 56.59757 57.69407 57.54603 56.35654 55.04907 58.34852 57.67035
[9] 54.97442 52.28298
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.80474 65.58414 66.09179 71.55840 71.96713 67.62565 73.12510
[8] 70.08972 70.84638 71.78116 75.09183 68.40302 68.06473 76.57008
[15] 69.85845 69.51669 73.02756 67.30717 72.65780 75.57013
> colSums(tmp5,na.rm=TRUE)
[1] 1068.0474 655.8414 660.9179 715.5840 719.6713 676.2565 731.2510
[8] 700.8972 708.4638 717.8116 750.9183 684.0302 680.6473 765.7008
[15] 698.5845 695.1669 730.2756 673.0717 653.9202 755.7013
> colVars(tmp5,na.rm=TRUE)
[1] 16401.83317 73.93268 94.34114 93.89819 41.31412 72.00777
[7] 61.74676 53.30214 34.46668 98.75676 125.67840 83.55060
[13] 33.77236 64.05426 49.75931 115.05674 146.96489 92.15557
[19] 77.91667 50.78914
> colSd(tmp5,na.rm=TRUE)
[1] 128.069642 8.598411 9.712937 9.690108 6.427606 8.485739
[7] 7.857911 7.300831 5.870833 9.937644 11.210638 9.140602
[13] 5.811399 8.003391 7.054028 10.726450 12.122908 9.599769
[19] 8.827042 7.126650
> colMax(tmp5,na.rm=TRUE)
[1] 470.54607 81.40943 81.19519 83.91480 79.36667 83.38747 83.76260
[8] 81.43705 80.73061 85.12633 90.71728 90.90478 81.24159 94.20310
[15] 80.10613 83.68661 93.42946 83.28686 84.89745 83.23596
> colMin(tmp5,na.rm=TRUE)
[1] 56.46076 56.81992 52.28298 57.16315 62.24277 54.97442 61.30233 60.70808
[9] 63.84281 57.50538 57.87085 57.49652 60.20221 65.90507 61.11185 56.35654
[17] 57.69407 56.08076 55.04907 63.77572
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.15276 70.78728 70.69584 70.38733 70.68386 71.65677 72.21237 70.90119
[9] 71.33716 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.055 1415.746 1413.917 1407.747 1413.677 1433.135 1444.247 1418.024
[9] 1426.743 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 8129.26061 95.39635 43.82923 56.31381 104.19443 129.70346
[7] 62.29614 71.36406 97.37098 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 90.162412 9.767105 6.620365 7.504253 10.207567 11.388743 7.892790
[8] 8.447725 9.867674 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 470.54607 84.89745 82.59706 83.76260 94.20310 93.42946 83.91480
[8] 90.90478 85.12633 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 56.25916 56.59757 57.69407 57.54603 56.35654 55.04907 58.34852 57.67035
[9] 54.97442 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.97287 66.55794 67.62610 73.15787 72.90304 67.94919 72.85598
[8] 69.02676 69.74813 70.49665 74.80176 68.63868 68.02351 77.75508
[15] 70.36886 68.88248 73.57095 68.55455 NaN 76.26193
> colSums(tmp5,na.rm=TRUE)
[1] 1007.7558 599.0215 608.6349 658.4208 656.1274 611.5427 655.7038
[8] 621.2408 627.7332 634.4699 673.2158 617.7481 612.2116 699.7957
[15] 633.3197 619.9423 662.1385 616.9909 0.0000 686.3573
> colVars(tmp5,na.rm=TRUE)
[1] 18151.58005 72.50599 79.65001 76.85448 36.62406 79.83114
[7] 68.65032 47.25379 25.20585 92.53926 140.44157 93.36964
[13] 37.97479 56.26349 53.04844 124.91386 162.01367 86.17053
[19] NA 51.75382
> colSd(tmp5,na.rm=TRUE)
[1] 134.727800 8.515045 8.924685 8.766669 6.051781 8.934827
[7] 8.285549 6.874139 5.020543 9.619733 11.850805 9.662797
[13] 6.162369 7.500899 7.283436 11.176487 12.728459 9.282808
[19] NA 7.194013
> colMax(tmp5,na.rm=TRUE)
[1] 470.54607 81.40943 81.19519 83.91480 79.36667 83.38747 83.76260
[8] 81.43705 77.87022 85.12633 90.71728 90.90478 81.24159 94.20310
[15] 80.10613 83.68661 93.42946 83.28686 -Inf 83.23596
> colMin(tmp5,na.rm=TRUE)
[1] 56.46076 58.13569 57.11273 59.40386 62.24277 54.97442 61.30233 60.70808
[9] 63.84281 57.50538 57.87085 57.49652 60.20221 67.81931 61.11185 56.35654
[17] 57.69407 56.25916 Inf 63.77572
>
>
>
>
> 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] 350.7897 182.6325 143.6535 149.1385 309.6895 359.2232 188.5977 215.9517
[9] 211.6371 239.0593
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 350.7897 182.6325 143.6535 149.1385 309.6895 359.2232 188.5977 215.9517
[9] 211.6371 239.0593
>
>
>
> 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 5.684342e-14 -5.684342e-14 -8.526513e-14 -2.273737e-13
[6] 8.526513e-14 -1.421085e-13 -5.684342e-14 1.136868e-13 7.105427e-14
[11] 2.842171e-14 0.000000e+00 -1.136868e-13 0.000000e+00 -3.126388e-13
[16] 1.705303e-13 1.705303e-13 5.684342e-14 -1.136868e-13 2.842171e-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)
+ }
6 16
1 4
8 4
9 5
6 4
7 19
10 6
8 14
1 18
2 20
6 5
5 15
3 5
8 8
9 4
2 9
10 15
2 9
4 1
9 6
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.439038
> Min(tmp)
[1] -2.246671
> mean(tmp)
[1] -0.09249318
> Sum(tmp)
[1] -9.249318
> Var(tmp)
[1] 0.9471419
>
> rowMeans(tmp)
[1] -0.09249318
> rowSums(tmp)
[1] -9.249318
> rowVars(tmp)
[1] 0.9471419
> rowSd(tmp)
[1] 0.9732121
> rowMax(tmp)
[1] 2.439038
> rowMin(tmp)
[1] -2.246671
>
> colMeans(tmp)
[1] 0.08825597 -0.04107777 -1.25712869 0.65092392 -1.13929975 -0.55754135
[7] 1.30657700 -0.70108842 1.75382970 -2.23692157 -1.00955840 0.12758800
[13] -0.57588480 -1.72396898 -0.44714779 0.29342607 -1.48246659 -0.01497066
[19] 1.61337989 0.51823649 0.01839886 0.80846429 -0.56516610 2.43903804
[25] 0.47629005 -0.75291128 -0.20243830 1.14170893 0.57039866 0.14295830
[31] -0.01297253 0.25936371 -0.16655019 0.53635888 0.18631603 -0.08445177
[37] 0.29115871 1.56595257 -1.19000397 0.82465822 -0.37009448 -0.63191199
[43] 1.09484627 1.32477740 -0.48575539 0.56140756 -0.85844967 -1.07806090
[49] -0.10135023 -0.09355901 -2.24667111 0.62876620 -1.27339077 0.95649860
[55] -0.13629923 -1.63316076 -0.41236578 1.73512192 -0.77877832 0.59095122
[61] -0.40381775 -0.26647394 -0.45444525 -0.75130937 0.21167744 0.11836719
[67] 0.81002751 -1.94543056 0.75105975 0.08352191 0.85971904 -0.40264944
[73] -1.22035220 0.67729585 -1.66259093 0.37557170 -0.38536200 0.95902941
[79] 0.15469264 -2.04768860 -0.75053993 0.44215552 -1.22720294 -0.33233595
[85] -1.14068104 0.85873687 0.39224988 -0.68048126 1.86126904 -0.95351182
[91] -0.46909984 -0.01478074 -1.03490506 1.78588688 -1.23242992 1.20630490
[97] -0.84693108 0.12532346 0.09814203 -1.04158444
> colSums(tmp)
[1] 0.08825597 -0.04107777 -1.25712869 0.65092392 -1.13929975 -0.55754135
[7] 1.30657700 -0.70108842 1.75382970 -2.23692157 -1.00955840 0.12758800
[13] -0.57588480 -1.72396898 -0.44714779 0.29342607 -1.48246659 -0.01497066
[19] 1.61337989 0.51823649 0.01839886 0.80846429 -0.56516610 2.43903804
[25] 0.47629005 -0.75291128 -0.20243830 1.14170893 0.57039866 0.14295830
[31] -0.01297253 0.25936371 -0.16655019 0.53635888 0.18631603 -0.08445177
[37] 0.29115871 1.56595257 -1.19000397 0.82465822 -0.37009448 -0.63191199
[43] 1.09484627 1.32477740 -0.48575539 0.56140756 -0.85844967 -1.07806090
[49] -0.10135023 -0.09355901 -2.24667111 0.62876620 -1.27339077 0.95649860
[55] -0.13629923 -1.63316076 -0.41236578 1.73512192 -0.77877832 0.59095122
[61] -0.40381775 -0.26647394 -0.45444525 -0.75130937 0.21167744 0.11836719
[67] 0.81002751 -1.94543056 0.75105975 0.08352191 0.85971904 -0.40264944
[73] -1.22035220 0.67729585 -1.66259093 0.37557170 -0.38536200 0.95902941
[79] 0.15469264 -2.04768860 -0.75053993 0.44215552 -1.22720294 -0.33233595
[85] -1.14068104 0.85873687 0.39224988 -0.68048126 1.86126904 -0.95351182
[91] -0.46909984 -0.01478074 -1.03490506 1.78588688 -1.23242992 1.20630490
[97] -0.84693108 0.12532346 0.09814203 -1.04158444
> 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.08825597 -0.04107777 -1.25712869 0.65092392 -1.13929975 -0.55754135
[7] 1.30657700 -0.70108842 1.75382970 -2.23692157 -1.00955840 0.12758800
[13] -0.57588480 -1.72396898 -0.44714779 0.29342607 -1.48246659 -0.01497066
[19] 1.61337989 0.51823649 0.01839886 0.80846429 -0.56516610 2.43903804
[25] 0.47629005 -0.75291128 -0.20243830 1.14170893 0.57039866 0.14295830
[31] -0.01297253 0.25936371 -0.16655019 0.53635888 0.18631603 -0.08445177
[37] 0.29115871 1.56595257 -1.19000397 0.82465822 -0.37009448 -0.63191199
[43] 1.09484627 1.32477740 -0.48575539 0.56140756 -0.85844967 -1.07806090
[49] -0.10135023 -0.09355901 -2.24667111 0.62876620 -1.27339077 0.95649860
[55] -0.13629923 -1.63316076 -0.41236578 1.73512192 -0.77877832 0.59095122
[61] -0.40381775 -0.26647394 -0.45444525 -0.75130937 0.21167744 0.11836719
[67] 0.81002751 -1.94543056 0.75105975 0.08352191 0.85971904 -0.40264944
[73] -1.22035220 0.67729585 -1.66259093 0.37557170 -0.38536200 0.95902941
[79] 0.15469264 -2.04768860 -0.75053993 0.44215552 -1.22720294 -0.33233595
[85] -1.14068104 0.85873687 0.39224988 -0.68048126 1.86126904 -0.95351182
[91] -0.46909984 -0.01478074 -1.03490506 1.78588688 -1.23242992 1.20630490
[97] -0.84693108 0.12532346 0.09814203 -1.04158444
> colMin(tmp)
[1] 0.08825597 -0.04107777 -1.25712869 0.65092392 -1.13929975 -0.55754135
[7] 1.30657700 -0.70108842 1.75382970 -2.23692157 -1.00955840 0.12758800
[13] -0.57588480 -1.72396898 -0.44714779 0.29342607 -1.48246659 -0.01497066
[19] 1.61337989 0.51823649 0.01839886 0.80846429 -0.56516610 2.43903804
[25] 0.47629005 -0.75291128 -0.20243830 1.14170893 0.57039866 0.14295830
[31] -0.01297253 0.25936371 -0.16655019 0.53635888 0.18631603 -0.08445177
[37] 0.29115871 1.56595257 -1.19000397 0.82465822 -0.37009448 -0.63191199
[43] 1.09484627 1.32477740 -0.48575539 0.56140756 -0.85844967 -1.07806090
[49] -0.10135023 -0.09355901 -2.24667111 0.62876620 -1.27339077 0.95649860
[55] -0.13629923 -1.63316076 -0.41236578 1.73512192 -0.77877832 0.59095122
[61] -0.40381775 -0.26647394 -0.45444525 -0.75130937 0.21167744 0.11836719
[67] 0.81002751 -1.94543056 0.75105975 0.08352191 0.85971904 -0.40264944
[73] -1.22035220 0.67729585 -1.66259093 0.37557170 -0.38536200 0.95902941
[79] 0.15469264 -2.04768860 -0.75053993 0.44215552 -1.22720294 -0.33233595
[85] -1.14068104 0.85873687 0.39224988 -0.68048126 1.86126904 -0.95351182
[91] -0.46909984 -0.01478074 -1.03490506 1.78588688 -1.23242992 1.20630490
[97] -0.84693108 0.12532346 0.09814203 -1.04158444
> colMedians(tmp)
[1] 0.08825597 -0.04107777 -1.25712869 0.65092392 -1.13929975 -0.55754135
[7] 1.30657700 -0.70108842 1.75382970 -2.23692157 -1.00955840 0.12758800
[13] -0.57588480 -1.72396898 -0.44714779 0.29342607 -1.48246659 -0.01497066
[19] 1.61337989 0.51823649 0.01839886 0.80846429 -0.56516610 2.43903804
[25] 0.47629005 -0.75291128 -0.20243830 1.14170893 0.57039866 0.14295830
[31] -0.01297253 0.25936371 -0.16655019 0.53635888 0.18631603 -0.08445177
[37] 0.29115871 1.56595257 -1.19000397 0.82465822 -0.37009448 -0.63191199
[43] 1.09484627 1.32477740 -0.48575539 0.56140756 -0.85844967 -1.07806090
[49] -0.10135023 -0.09355901 -2.24667111 0.62876620 -1.27339077 0.95649860
[55] -0.13629923 -1.63316076 -0.41236578 1.73512192 -0.77877832 0.59095122
[61] -0.40381775 -0.26647394 -0.45444525 -0.75130937 0.21167744 0.11836719
[67] 0.81002751 -1.94543056 0.75105975 0.08352191 0.85971904 -0.40264944
[73] -1.22035220 0.67729585 -1.66259093 0.37557170 -0.38536200 0.95902941
[79] 0.15469264 -2.04768860 -0.75053993 0.44215552 -1.22720294 -0.33233595
[85] -1.14068104 0.85873687 0.39224988 -0.68048126 1.86126904 -0.95351182
[91] -0.46909984 -0.01478074 -1.03490506 1.78588688 -1.23242992 1.20630490
[97] -0.84693108 0.12532346 0.09814203 -1.04158444
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.08825597 -0.04107777 -1.257129 0.6509239 -1.1393 -0.5575413 1.306577
[2,] 0.08825597 -0.04107777 -1.257129 0.6509239 -1.1393 -0.5575413 1.306577
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.7010884 1.75383 -2.236922 -1.009558 0.127588 -0.5758848 -1.723969
[2,] -0.7010884 1.75383 -2.236922 -1.009558 0.127588 -0.5758848 -1.723969
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.4471478 0.2934261 -1.482467 -0.01497066 1.61338 0.5182365 0.01839886
[2,] -0.4471478 0.2934261 -1.482467 -0.01497066 1.61338 0.5182365 0.01839886
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.8084643 -0.5651661 2.439038 0.4762901 -0.7529113 -0.2024383 1.141709
[2,] 0.8084643 -0.5651661 2.439038 0.4762901 -0.7529113 -0.2024383 1.141709
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.5703987 0.1429583 -0.01297253 0.2593637 -0.1665502 0.5363589 0.186316
[2,] 0.5703987 0.1429583 -0.01297253 0.2593637 -0.1665502 0.5363589 0.186316
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.08445177 0.2911587 1.565953 -1.190004 0.8246582 -0.3700945 -0.631912
[2,] -0.08445177 0.2911587 1.565953 -1.190004 0.8246582 -0.3700945 -0.631912
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.094846 1.324777 -0.4857554 0.5614076 -0.8584497 -1.078061 -0.1013502
[2,] 1.094846 1.324777 -0.4857554 0.5614076 -0.8584497 -1.078061 -0.1013502
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.09355901 -2.246671 0.6287662 -1.273391 0.9564986 -0.1362992 -1.633161
[2,] -0.09355901 -2.246671 0.6287662 -1.273391 0.9564986 -0.1362992 -1.633161
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.4123658 1.735122 -0.7787783 0.5909512 -0.4038177 -0.2664739 -0.4544452
[2,] -0.4123658 1.735122 -0.7787783 0.5909512 -0.4038177 -0.2664739 -0.4544452
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.7513094 0.2116774 0.1183672 0.8100275 -1.945431 0.7510597 0.08352191
[2,] -0.7513094 0.2116774 0.1183672 0.8100275 -1.945431 0.7510597 0.08352191
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.859719 -0.4026494 -1.220352 0.6772959 -1.662591 0.3755717 -0.385362
[2,] 0.859719 -0.4026494 -1.220352 0.6772959 -1.662591 0.3755717 -0.385362
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.9590294 0.1546926 -2.047689 -0.7505399 0.4421555 -1.227203 -0.332336
[2,] 0.9590294 0.1546926 -2.047689 -0.7505399 0.4421555 -1.227203 -0.332336
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.140681 0.8587369 0.3922499 -0.6804813 1.861269 -0.9535118 -0.4690998
[2,] -1.140681 0.8587369 0.3922499 -0.6804813 1.861269 -0.9535118 -0.4690998
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.01478074 -1.034905 1.785887 -1.23243 1.206305 -0.8469311 0.1253235
[2,] -0.01478074 -1.034905 1.785887 -1.23243 1.206305 -0.8469311 0.1253235
[,99] [,100]
[1,] 0.09814203 -1.041584
[2,] 0.09814203 -1.041584
>
>
> Max(tmp2)
[1] 2.349514
> Min(tmp2)
[1] -3.193028
> mean(tmp2)
[1] -0.03745633
> Sum(tmp2)
[1] -3.745633
> Var(tmp2)
[1] 1.141153
>
> rowMeans(tmp2)
[1] -1.002756046 1.685462189 0.059984492 -1.176999454 0.251855739
[6] -1.660745748 2.059586954 -0.690628593 -0.713077474 0.349628854
[11] 0.375017648 -1.268426925 -0.533550907 0.516070454 1.735089173
[16] 0.235159050 0.192325762 1.245141620 -0.363994584 -0.593178684
[21] -0.906922015 -0.587702403 -0.731842087 0.169966348 -0.990538614
[26] 0.784697951 0.806586712 -0.056455695 -0.475044763 2.110544761
[31] 1.607706758 -0.337919893 2.349513996 -1.780676325 1.075633599
[36] -0.441880527 2.125258349 2.019190772 0.591297143 2.074361326
[41] 1.811199411 -0.843592284 0.719083176 0.500389938 -0.196611231
[46] -0.892070762 0.176535847 0.720206008 -0.367589802 -3.193027981
[51] 0.385018345 0.470921818 -0.774076400 0.677554506 -1.400621739
[56] 0.441087306 -0.914284057 0.076893723 -0.259727913 -0.268144588
[61] 0.366197121 1.317890048 0.156004480 0.309680130 1.060433970
[66] 0.556461683 -0.849776103 -0.860289439 -1.564404425 -0.627715508
[71] -0.501426846 -0.023784689 -1.576780323 -0.537409733 -1.690960826
[76] 0.201550724 0.874549591 -0.772513288 -0.006368014 0.773378453
[81] -0.248678495 0.136489233 -1.045286343 -1.074448458 0.835494559
[86] 0.793542807 -0.566278674 -1.418097611 -0.224646318 -0.634314038
[91] 0.019521284 -0.832260946 0.468469361 0.094172456 -1.251795806
[96] -1.335917834 -2.786790259 -0.406746168 1.020914214 1.129424831
> rowSums(tmp2)
[1] -1.002756046 1.685462189 0.059984492 -1.176999454 0.251855739
[6] -1.660745748 2.059586954 -0.690628593 -0.713077474 0.349628854
[11] 0.375017648 -1.268426925 -0.533550907 0.516070454 1.735089173
[16] 0.235159050 0.192325762 1.245141620 -0.363994584 -0.593178684
[21] -0.906922015 -0.587702403 -0.731842087 0.169966348 -0.990538614
[26] 0.784697951 0.806586712 -0.056455695 -0.475044763 2.110544761
[31] 1.607706758 -0.337919893 2.349513996 -1.780676325 1.075633599
[36] -0.441880527 2.125258349 2.019190772 0.591297143 2.074361326
[41] 1.811199411 -0.843592284 0.719083176 0.500389938 -0.196611231
[46] -0.892070762 0.176535847 0.720206008 -0.367589802 -3.193027981
[51] 0.385018345 0.470921818 -0.774076400 0.677554506 -1.400621739
[56] 0.441087306 -0.914284057 0.076893723 -0.259727913 -0.268144588
[61] 0.366197121 1.317890048 0.156004480 0.309680130 1.060433970
[66] 0.556461683 -0.849776103 -0.860289439 -1.564404425 -0.627715508
[71] -0.501426846 -0.023784689 -1.576780323 -0.537409733 -1.690960826
[76] 0.201550724 0.874549591 -0.772513288 -0.006368014 0.773378453
[81] -0.248678495 0.136489233 -1.045286343 -1.074448458 0.835494559
[86] 0.793542807 -0.566278674 -1.418097611 -0.224646318 -0.634314038
[91] 0.019521284 -0.832260946 0.468469361 0.094172456 -1.251795806
[96] -1.335917834 -2.786790259 -0.406746168 1.020914214 1.129424831
> 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] -1.002756046 1.685462189 0.059984492 -1.176999454 0.251855739
[6] -1.660745748 2.059586954 -0.690628593 -0.713077474 0.349628854
[11] 0.375017648 -1.268426925 -0.533550907 0.516070454 1.735089173
[16] 0.235159050 0.192325762 1.245141620 -0.363994584 -0.593178684
[21] -0.906922015 -0.587702403 -0.731842087 0.169966348 -0.990538614
[26] 0.784697951 0.806586712 -0.056455695 -0.475044763 2.110544761
[31] 1.607706758 -0.337919893 2.349513996 -1.780676325 1.075633599
[36] -0.441880527 2.125258349 2.019190772 0.591297143 2.074361326
[41] 1.811199411 -0.843592284 0.719083176 0.500389938 -0.196611231
[46] -0.892070762 0.176535847 0.720206008 -0.367589802 -3.193027981
[51] 0.385018345 0.470921818 -0.774076400 0.677554506 -1.400621739
[56] 0.441087306 -0.914284057 0.076893723 -0.259727913 -0.268144588
[61] 0.366197121 1.317890048 0.156004480 0.309680130 1.060433970
[66] 0.556461683 -0.849776103 -0.860289439 -1.564404425 -0.627715508
[71] -0.501426846 -0.023784689 -1.576780323 -0.537409733 -1.690960826
[76] 0.201550724 0.874549591 -0.772513288 -0.006368014 0.773378453
[81] -0.248678495 0.136489233 -1.045286343 -1.074448458 0.835494559
[86] 0.793542807 -0.566278674 -1.418097611 -0.224646318 -0.634314038
[91] 0.019521284 -0.832260946 0.468469361 0.094172456 -1.251795806
[96] -1.335917834 -2.786790259 -0.406746168 1.020914214 1.129424831
> rowMin(tmp2)
[1] -1.002756046 1.685462189 0.059984492 -1.176999454 0.251855739
[6] -1.660745748 2.059586954 -0.690628593 -0.713077474 0.349628854
[11] 0.375017648 -1.268426925 -0.533550907 0.516070454 1.735089173
[16] 0.235159050 0.192325762 1.245141620 -0.363994584 -0.593178684
[21] -0.906922015 -0.587702403 -0.731842087 0.169966348 -0.990538614
[26] 0.784697951 0.806586712 -0.056455695 -0.475044763 2.110544761
[31] 1.607706758 -0.337919893 2.349513996 -1.780676325 1.075633599
[36] -0.441880527 2.125258349 2.019190772 0.591297143 2.074361326
[41] 1.811199411 -0.843592284 0.719083176 0.500389938 -0.196611231
[46] -0.892070762 0.176535847 0.720206008 -0.367589802 -3.193027981
[51] 0.385018345 0.470921818 -0.774076400 0.677554506 -1.400621739
[56] 0.441087306 -0.914284057 0.076893723 -0.259727913 -0.268144588
[61] 0.366197121 1.317890048 0.156004480 0.309680130 1.060433970
[66] 0.556461683 -0.849776103 -0.860289439 -1.564404425 -0.627715508
[71] -0.501426846 -0.023784689 -1.576780323 -0.537409733 -1.690960826
[76] 0.201550724 0.874549591 -0.772513288 -0.006368014 0.773378453
[81] -0.248678495 0.136489233 -1.045286343 -1.074448458 0.835494559
[86] 0.793542807 -0.566278674 -1.418097611 -0.224646318 -0.634314038
[91] 0.019521284 -0.832260946 0.468469361 0.094172456 -1.251795806
[96] -1.335917834 -2.786790259 -0.406746168 1.020914214 1.129424831
>
> colMeans(tmp2)
[1] -0.03745633
> colSums(tmp2)
[1] -3.745633
> colVars(tmp2)
[1] 1.141153
> colSd(tmp2)
[1] 1.068248
> colMax(tmp2)
[1] 2.349514
> colMin(tmp2)
[1] -3.193028
> colMedians(tmp2)
[1] -0.01507635
> colRanges(tmp2)
[,1]
[1,] -3.193028
[2,] 2.349514
>
> 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.118405 -2.522670 -3.777438 -3.035230 1.055821 1.721520 4.498025
[8] 3.717491 -4.311979 1.079496
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.8555330
[2,] -0.0396276
[3,] 0.4453529
[4,] 0.7044279
[5,] 2.7082916
>
> rowApply(tmp,sum)
[1] 4.4795961 2.7297329 -1.4095153 5.6874268 -1.0070304 -0.2490625
[7] 0.2698164 -1.5568123 -3.7767216 -2.6239872
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 9 8 10 6 7 6 10 1 4
[2,] 8 4 1 6 7 3 10 1 4 8
[3,] 5 2 3 8 2 1 7 7 3 5
[4,] 6 8 4 5 1 2 1 5 6 6
[5,] 1 6 6 1 4 10 8 8 8 7
[6,] 4 3 5 7 3 9 3 9 9 9
[7,] 10 10 10 2 5 5 9 3 7 1
[8,] 9 5 7 9 10 4 5 6 5 10
[9,] 2 1 2 3 8 8 4 4 2 2
[10,] 7 7 9 4 9 6 2 2 10 3
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.45756133 -0.97852418 -2.85677127 -3.49187428 -1.71894422 3.65046572
[7] 0.47916216 -0.62002656 -1.57912543 -0.48356285 -0.52140342 -0.09582768
[13] -2.36385674 2.24913068 6.21780466 -1.90606376 5.30184736 1.84544151
[19] -1.02122773 -2.89941065
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7442883
[2,] -0.6175986
[3,] -0.5274086
[4,] 0.1280225
[5,] 0.3037117
>
> rowApply(tmp,sum)
[1] -2.0555274 2.9393383 2.7220126 -0.1806381 -6.6755134
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 2 12 15 9
[2,] 5 17 7 4 14
[3,] 3 9 8 6 4
[4,] 11 1 3 8 7
[5,] 15 12 13 2 3
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.6175986 -0.8746836 -1.15177706 -0.08195885 0.3900176 -0.5029955
[2,] -1.7442883 1.1505615 0.04898841 -1.83465038 0.3056352 1.8984745
[3,] 0.1280225 -0.2727031 -0.12591124 -0.67792419 0.1564397 -0.4432196
[4,] 0.3037117 -0.8114034 -0.35040823 -0.17986871 -1.2524552 1.8408179
[5,] -0.5274086 -0.1702956 -1.27766314 -0.71747215 -1.3185815 0.8573884
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.04306007 0.04592564 -1.20036994 0.52071635 -0.55690838 -0.6706728
[2,] 1.04167419 -0.15611405 0.20416602 0.68653237 -0.55521184 -0.6647921
[3,] 0.11239343 -0.49010797 0.68813353 -0.94671158 1.05090810 1.1715398
[4,] -0.08932285 0.47392929 -1.22292894 0.09122494 -0.04268435 1.3903651
[5,] -0.54252253 -0.49365947 -0.04812609 -0.83532493 -0.41750696 -1.3222676
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.8619740 2.20638314 1.7821352 -0.8163154 1.64470097 0.46072660
[2,] 0.6457090 -0.92328306 1.2972937 -0.9719810 1.42339828 0.91739117
[3,] 0.7992793 -0.11193842 0.7519572 1.6690656 0.09962954 0.58652478
[4,] -0.3169032 -0.07053801 0.7037776 -1.5474332 1.71812659 -0.06484136
[5,] -1.6299678 1.14850703 1.6826409 -0.2393998 0.41599197 -0.05435968
[,19] [,20]
[1,] 0.14732940 -0.8751482
[2,] -0.11638426 0.2862190
[3,] -0.63192335 -0.7914413
[4,] 0.03034546 -0.7841492
[5,] -0.45059498 -0.7348909
>
>
> 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 : 654 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.1022221 1.090021 -0.3992777 1.425247 1.085699 -0.25455 -0.09425356
col8 col9 col10 col11 col12 col13 col14
row1 -0.3526368 -1.342228 0.3358621 -0.3954069 -0.9735703 -0.617964 -0.06072838
col15 col16 col17 col18 col19 col20
row1 0.8524035 0.06175463 -0.2197831 0.6309563 0.0167055 0.9744099
> tmp[,"col10"]
col10
row1 0.33586212
row2 -0.77428934
row3 0.94647145
row4 -0.09136369
row5 1.17799977
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.1022221 1.0900205 -0.3992777 1.425247 1.0856994 -0.2545500
row5 0.2255690 -0.9969932 0.2447919 1.845627 -0.8159206 0.7641637
col7 col8 col9 col10 col11 col12
row1 -0.09425356 -0.3526368 -1.342228 0.3358621 -0.3954069 -0.9735703
row5 0.90525028 -1.6022946 1.059207 1.1779998 -1.8371578 0.6712034
col13 col14 col15 col16 col17 col18
row1 -0.6179640 -0.06072838 0.8524035 0.06175463 -0.2197831 0.6309563
row5 0.7871178 0.13474468 -0.7066502 0.31650095 -0.3415131 -0.2039141
col19 col20
row1 0.0167055 0.9744099
row5 1.2264119 -1.4408435
> tmp[,c("col6","col20")]
col6 col20
row1 -0.2545500 0.9744099
row2 -0.4414991 0.3289436
row3 0.4431612 -0.2210621
row4 -2.6707062 -0.4668836
row5 0.7641637 -1.4408435
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.2545500 0.9744099
row5 0.7641637 -1.4408435
>
>
>
>
> 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 48.82709 48.54661 50.07344 51.97136 49.81377 104.7084 49.76619 48.67816
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.26687 49.7024 50.30536 50.32467 48.57964 50.6192 50.85992 50.33348
col17 col18 col19 col20
row1 51.45886 49.97281 50.00797 105.0278
> tmp[,"col10"]
col10
row1 49.70240
row2 30.62164
row3 30.98476
row4 29.99840
row5 50.60076
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.82709 48.54661 50.07344 51.97136 49.81377 104.7084 49.76619 48.67816
row5 50.15525 50.23226 49.48860 51.11362 49.58479 104.0530 51.03120 50.95303
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.26687 49.70240 50.30536 50.32467 48.57964 50.61920 50.85992 50.33348
row5 48.84894 50.60076 48.47427 48.65264 49.80134 50.79112 49.52475 48.96155
col17 col18 col19 col20
row1 51.45886 49.97281 50.00797 105.0278
row5 49.35855 49.79859 48.94231 103.7794
> tmp[,c("col6","col20")]
col6 col20
row1 104.70838 105.02779
row2 73.42542 74.14997
row3 74.70525 74.30565
row4 74.05840 74.85650
row5 104.05298 103.77943
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.7084 105.0278
row5 104.0530 103.7794
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.7084 105.0278
row5 104.0530 103.7794
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.4174771
[2,] 3.2024869
[3,] -1.4268355
[4,] 3.5705453
[5,] -0.6149372
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.1400305 -1.0612668
[2,] 1.8814493 -0.1548858
[3,] 1.1073205 0.8099536
[4,] 1.5462582 0.4188209
[5,] 0.9572039 -2.0882583
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.02668589 -0.9531971
[2,] -1.71954444 -0.7574194
[3,] -0.72803583 -1.6614293
[4,] 1.82372937 -0.6499444
[5,] 1.16656942 2.6202619
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.02668589
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.02668589
[2,] -1.71954444
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -0.6278054 1.796527 0.4417164 -0.04677786 -0.6043760 -0.1765489
row1 -1.0318954 -1.097072 -1.0037473 -0.08792606 -0.3656634 0.2817239
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.2825044 -0.2340646 -0.93712248 -1.1529526 -2.02126 0.09884205
row1 0.8951781 0.3555192 -0.03380124 -0.2027584 -1.60536 -1.09534124
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -1.4213487 0.01844155 -0.3643067 -2.07541042 0.9695228 1.3997150
row1 0.8756844 -2.19523871 -0.2417315 -0.05707963 -1.1012413 -0.6771758
[,19] [,20]
row3 -0.1751844 -2.3849700
row1 2.5358113 0.7107989
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.9599051 -1.585463 -1.242165 -1.238419 -0.8956094 0.655646 0.6348001
[,8] [,9] [,10]
row2 0.2511101 -0.1376878 0.1771445
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.075384 -0.08575168 -0.04744036 0.8865325 -0.1702751 0.9920264 1.03732
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.5425324 0.5547767 -2.020235 -1.244029 -1.980283 -0.4635228 -0.5858172
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.2823364 0.2578986 0.8995475 0.6353846 0.7180372 -0.1434318
>
>
> 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: 0xc3f1a4660>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14039698bd144"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140395a57fd7e"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1403946c38988"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140394f7a6403"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140396c3c29b8"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1403961d7268b"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140397423a1db"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140394f576c6e"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14039748fd273"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM14039e41b7ce"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140397c8a3cb1"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140395796c857"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140396c3af4ad"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM140391295c15e"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1403925ca0bda"
>
>
> ### 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: 0xc3f1a5200>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xc3f1a5200>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0xc3f1a5200>
> rowMedians(tmp)
[1] 0.656990294 0.024909932 -0.145370845 -0.236598193 0.055880244
[6] 0.714469756 0.624845511 -0.317693991 -0.160371788 -0.033557782
[11] -0.387273665 -0.160017927 0.160758542 0.183277043 0.302942599
[16] -0.659448515 -0.147454837 -0.530850589 0.570496800 0.029198959
[21] -0.450256836 -0.173569202 0.148273751 -0.055900084 0.031782848
[26] -0.126736123 -0.154119951 0.085088570 -0.006430767 -0.317278538
[31] 0.255794437 0.002084417 0.572459905 0.698493237 -0.098738873
[36] -0.305986894 -0.358838935 -0.409978933 -0.002952392 0.103252071
[41] -0.075434305 0.562566962 -0.274030146 -0.964528267 0.048169134
[46] 0.157463408 0.424456055 -0.494891220 0.043183403 -0.142724895
[51] 0.037666143 0.150089150 0.167101596 -0.482387411 0.075543135
[56] -0.277333023 -0.542539268 0.071009547 0.234282087 -0.042579247
[61] -0.486570863 -0.175758493 -0.143624048 -0.114009264 0.107680144
[66] -0.052211408 -0.006229295 0.203758401 -0.299019153 -0.424194415
[71] -0.292585111 -0.037508704 0.029639456 -0.040738932 0.162838047
[76] -0.066943315 -0.562690932 -0.141850436 -0.577848604 -0.012516880
[81] 0.520314401 -0.145234994 -0.199510964 -0.214515484 -0.121987692
[86] -0.004876836 -0.351287233 -0.291551552 0.029543637 0.351686172
[91] 0.156349419 -0.259141891 -0.242884445 -0.190113189 -0.529867398
[96] -0.077073313 -0.314554829 0.436106630 -0.414251322 0.538758856
[101] -0.077277601 -0.035158096 0.187986828 0.435385937 -0.463785607
[106] -0.280307558 -0.189454495 -0.205980784 0.202676843 -0.041078566
[111] -0.248181660 0.061928987 -0.298242635 -0.542018807 0.372672978
[116] 0.188717643 -0.094237552 -0.319915717 0.198432386 -0.520236264
[121] 0.146868290 -0.463424135 -0.541144934 0.035559033 0.067357631
[126] 0.243112619 -0.184924979 -0.070647264 -0.554812049 -0.139716646
[131] 0.022552072 -0.064149903 -0.297030019 0.053639890 0.179099709
[136] 0.168978687 0.170484149 0.165910622 0.137434282 -0.167450240
[141] -0.385145475 0.236629191 0.412637391 0.152487934 0.409695813
[146] -0.121387986 0.084653676 0.092679532 0.143707745 -0.013069468
[151] 0.459702114 0.084107384 -0.144937001 0.092922619 -0.055728046
[156] 0.594280549 -0.172097903 -0.838810418 0.135500945 0.218179937
[161] -0.023413710 0.624233117 -0.126733058 0.088338686 -0.001661487
[166] -0.368317904 -0.307481246 0.148140856 0.313257704 -0.296635530
[171] 0.541252000 0.265505642 -0.080790719 0.072404987 0.286061791
[176] 0.171716752 -0.506446696 -0.111648751 0.040920053 0.040191449
[181] 0.150530032 0.147295663 -0.195741718 -0.423283408 0.555146298
[186] -0.016685446 0.479759553 0.147931714 -0.211501087 -0.138662001
[191] -0.267171386 -0.488514378 0.301362727 0.157304771 -0.487741931
[196] -0.105876708 -0.056345047 0.430245807 -0.083913629 0.055515357
[201] 0.174694090 -0.146897066 -0.306016992 -0.455295067 -0.243889584
[206] -0.482245031 0.228059766 0.092137522 0.083072885 0.718536018
[211] -0.387065537 0.366560217 -0.016497874 -0.552392389 -0.246751019
[216] 0.354037273 -0.496181945 0.086655109 0.110243062 0.725382185
[221] 0.382638255 -0.128502552 -0.162878467 -0.468209874 -0.069957347
[226] 0.372683574 0.563459354 -0.193720546 0.116871786 0.358558301
>
> proc.time()
user system elapsed
0.701 4.808 5.520
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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: 0x105765f30>
> .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: 0x105765f30>
> .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: 0x105765f30>
> .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: 0x105765f30>
> 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: 0xaa3a50000>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a50000>
> .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: 0xaa3a50000>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a50000>
> .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: 0xaa3a50000>
> 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: 0xaa3a503c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a503c0>
> .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: 0xaa3a503c0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaa3a503c0>
> .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: 0xaa3a503c0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0xaa3a503c0>
> .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: 0xaa3a503c0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0xaa3a503c0>
> .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: 0xaa3a503c0>
> 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: 0xaa3a504e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xaa3a504e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a504e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a504e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1448b3aceb38d" "BufferedMatrixFile1448b586e0c24"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1448b3aceb38d" "BufferedMatrixFile1448b586e0c24"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a50600>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a50600>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaa3a50600>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaa3a50600>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xaa3a50600>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xaa3a50600>
> .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: 0xaa3a50780>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaa3a50780>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaa3a50780>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xaa3a50780>
> 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: 0xaa3a508a0>
> .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: 0xaa3a508a0>
> rm(P)
>
> proc.time()
user system elapsed
0.120 0.048 0.163
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 alpha (2026-04-08 r89818)
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23
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.114 0.025 0.134